in reply to Re: How to parse not closed HTML tags that don't have any attributes? (updated)
in thread How to parse not closed HTML tags that don't have any attributes?
Many thanks again to everyone for all your great help!
All your solutions are very tempting. Especially regexp code always looks like pure magic to me. :-)
For the moment I've decided to go with the Mojo::DOM alternative, since I'm still very unexperienced with Perl, and since it's understandable for me at least to a little extent.
So far it gives me really promising results. There's this wall I ran into, though:
<div class="address"> <div class="icon"></div> <address> Sample Street 123<br/>45678 Randomcity </address> </div>
In there, the fields "Street name", "Street number", "ZIP code" and "City name" have been carelessly filled into just a single field, separated by the <br/> element.
With your help I'm now able to access the whole string with $dom->find('address'), but no matter what I do, the <br/> element in it always gets removed, so it seems to me that I cannot search inside the address string. I thought this might be because Perl treats it as white space, but I wasn't able to find anything useful.
Could you please give me a hint?
By the way, thank you for your advice to use Text::CSV. That's a great idea, and I will definitely do that!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to parse not closed HTML tags that don't have any attributes?
by haukex (Archbishop) on Mar 07, 2021 at 14:03 UTC | |
by Rantanplan (Novice) on Mar 07, 2021 at 16:40 UTC | |
by haukex (Archbishop) on Mar 07, 2021 at 17:47 UTC | |
by Rantanplan (Novice) on Mar 08, 2021 at 14:39 UTC | |
by haukex (Archbishop) on Mar 08, 2021 at 16:06 UTC | |
|