Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture data from an HTML file

Status
Not open for further replies.

OieL

MIS
Sep 6, 2002
17
0
0
US
Hi

I want to get data from an HTML file.
the lines that I want to put into an array is after the <PRE> and before the </PRE> tag

<HTML>
;
;
<PRE>
line 1
line 2
line 3
</PRE>
;
;
;
</HTML>

help
 
Code:
$html_stuff = qq(<HTML>
<head><title>Junk</title>
</head>
<body>
<PRE>
line 1
line 2
line 3
</PRE>
</body></HTML>);

if ($html_stuff =~ /<pre>(.*?)<\/pre>/is) {
    $pre_tags_had = $1;
    }
else { print &quot;No Luck, buddy.\n&quot;; }

I think that will grab the content of the first set of pre tags. 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top