Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: html parsing

by Anonymous Monk
on Mar 22, 2017 at 15:25 UTC ( [id://1185468]=note: print w/replies, xml ) Need Help??


in reply to Re: html parsing
in thread html parsing

"You could get the contents of the <title> tag just using a regular expression"

Solutions that use regular expressions to parse HTML will never be voted higher than those that actually use a parser. Also your assignment is very low value because it explicitly uses $1 when you could have instead captured the value directly (and safer too).

Replies are listed 'Best First'.
Re^3: html parsing
by shmem (Chancellor) on Mar 22, 2017 at 15:40 UTC

    I'd downvote my answer, if I could, not only for the shameless plug.

    Also your assignment is very low value because it explicitly uses $1 when you could have instead captured the value directly (and safer too).

    Providing code for that end might significantly improve this subthread.

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
      I was hoping you would do that. :)
      (my $title) = $res->content =~ m|<title>([^<]+)</title>|i;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1185468]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-24 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found