libwww-perl / WWW-Mechanize

Handy web browsing in a Perl object
https://metacpan.org/pod/WWW::Mechanize
Other
68 stars 53 forks source link

find_all_links fails if any one anchor tag is not closed properly #212

Open spazm opened 7 years ago

spazm commented 7 years ago

kmr.p...@gmail.com reported on Apr 9, 2012

What steps will reproduce the problem?
1. create an html page with more than one (say 15) anchor tags (corresponding closing tag also)
2. Now remove a closing anchor tag for the 11th anchor tag
3. Run mechanize and dump find_all_links contents. YOu will get only 10 entries.

What is the expected output? What do you see instead?
Expected all 15 links in the dump

What version of the product are you using? On what operating system?
VERSION = '1.70'

Please provide any additional information below.

Details

Imported from Google Code issue 235 via archive

Comments

kmr.p...@gmail.com commented on Apr 9, 2012 :

My preliminary analysis says that the problem lies in Modules's subroutine with name 
sub _extract_links which calls another subroutine with name _link_from_token

In the sub _link_from_token  , closing tag is being searched (and which is not found for the current open tag) at line number 2613 (in my version).