develooper Front page | perl.libwww | Postings from February 2001

Re: help parsing HTML code

Thread Previous
February 1, 2001 01:39
Re: help parsing HTML code
Message ID:
Marcel Grunauer wrote:

> In message <>, "gil cohen" writes:
>> You don't any of that weird stuff. All you need is a simple regex. In that 
>> $res->is_sucess if, put something like:
>> $content =~ m/<input type=\"text\" size=\"10\" name=\"video_fec_errors_rx\" 
>> value=\"(.*?)\" READONLY>/;
>> $value = $1;
>> and now $value has what value is equal to.
> Until someone decides to rearrange the parameters or make them uppercase
> or forgo quotes or split them among several lines.
> Better use one of the HTML parsing modules.
> BTW, no need to escape the quotes in the regex. And what happens if
> there is no match? Then $1 has an undefined value. about searching for all the <input> tags, and then parsing the 
name id tag (everything between name= and the \s), and stripping out " 
and ' where appropiate.

I was always told to code one step at a time. Sure it takes longer code, 
but it will get you everything. Also you can check the id tag for other 


Josh Barker, Web Researcher ( This mail may contain 
links to content of a illegal, immoral or sexual nature. These are not 
affliated with Inceptor and are for purposes of illustration only.

Tel : + 44 20 7661 9508 	F: + 44 20 7240 8098 		
MSN: 	AOL: Joshua C Barker
Mail: Inceptor, 33 St James's Square, London SW1, UK

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About