Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Extract data between script tags

by NetWallah (Canon)
on Jun 21, 2014 at 23:08 UTC ( [id://1090796]=note: print w/replies, xml ) Need Help??


in reply to Extract data between script tags

If script extraction is the only thing you need to do, this regex should do the job:
my @Extracted_scripts = $HTML_string =~/<script>(.+?)<\/script>/sig;
For anything more complex, use HTML::TreeBuilder or derivatives , or HTML::SimpleParse.

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2024-04-23 16:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found