Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi, I need to extract certain pieces of information from a website. There's a <p> tag with 5 <span> tags inside it. One of the spans has a class, so no problem, but the other 4 are just <span>info</span>. This is how the code looks in the website. I'm using Firebug.
My perl knowledge is limited to the first nine chapters of "Learning Perl" (and that doesn't mean I understand everything, especially sub routines) I don't have any other programming skills. This is the code I have so far:
And this is the output: Itinerario Danimarca, fiordi norvegesi, Germania Data partenza 17�giugno�2012 Nave Costa Fortuna N.ro giorni crociera � 7 Porto di partenza Copenhagen Documenti di viaggio Passaporto�o�Carta d'identit� valida per l'espatrio Possono essere disponibili le seguenti tariffeSo, this outputs all the information in one string and also with some strange characters, but I can use a regex to fix that. The main issue is that I need every string to be independent from each other (As if I wanted to add a title prior to each information itself). I see that the spans have <b>whatever</b> tags, but I just can't seem to understand how I could use those to do what I want. Like I said, my experience is close to zero. I've been trying different stuff with arrays and hashes and right now I just want to burn the computer. If the Monks could help me I would greatly appreciate it. Thank you so much! In reply to Parsing HTML by marcoss
|
|