| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Aug 2005 Location: East Yorkshire, England
Posts: 2,689
![]() ![]() ![]() ![]() ![]() ![]() ![]() | Perl Question edit: Fixed original error, now I need help with something else ----- How can I get the title of a page with LWP?
Last edited by Mikor; 08-25-2006 at 10:43 AM.
|
| |
| | #2 (permalink) |
| NamePros Regular Join Date: Nov 2005
Posts: 383
![]() ![]() | You can use the TokeParser: This assumes the content is returned to $content Code: $parser = HTML::TokeParser->new(\$content);
$parser->get_tag("title");
$title = $parser->get_token;
print $title->[1], "\n" if $title; |
| |
| | THREAD STARTER #3 (permalink) |
| Senior Member Join Date: Aug 2005 Location: East Yorkshire, England
Posts: 2,689
![]() ![]() ![]() ![]() ![]() ![]() ![]() | I've tried grep - but there is a problem: Code: @title = grep("<title>[a-z]</title>",$content);
push(@filetitles,@title); edit: fixed, used the wrong method for getting the content
Last edited by Mikor; 08-25-2006 at 11:58 AM.
|
| |