Aug 23, 2013, 6:42 AM
Post #1 of 3
return text between <title>-tags from html
I'm learning perl using a book PERL for beginners from geoffrey Sampson. I'm dedicated to start using PERL in my job.
However, there is a task that needs to be done rather quick.
I only got to the 50th page of the book and while I feel what I'm about to ask is probably a walk in the park for most of you, it's to complicated for me at this moment.
Here's what I'd need.
I have a file textfile containing hyperlinks.
The perl script should open the first hyperlink, scan the html file for the <title>-tags, and write the words between the title tags after the hyperlink in the textfile containing the hyperlinks.
After the script is done, the textfile should look like
http://www.example.com/1 webpage one
http://www.example.com/2 webpage two
Edit: I forgot to mention that every html-page has the same structure.
What would the code look like to do that?
Would the script read the entire html-file or just the <title>-tags?
I'm looking forward to the responses.
(This post was edited by just.marc.smith on Aug 23, 2013, 6:55 AM)