Can't use perl WWW::Mechanize to tick checkboxes

一曲冷凌霜 提交于 2019-12-13 04:47:38

问题


I am making a webscraper using perl WWW::Mechanize. My problem is the site that I am scraping is using javascript a bit too much. I am logging in using credentials, Then traversing to custom search using $mech->follow_link(url).

The problem starts from here. I am landing on to a page where I have to select one checkbox and one radiobutton from a javascript enabled dropdownlist. I am stuck at this point.

The part of html is as below. When I am using $mech->tick('cs-MajorIndustryGroup'), I am getting an error

Can't call method "find_input" on an undefined value

回答1:


WWW::Mechanize doesn't support JavaScript. You could try some of these modules:

  • Gtk2::WebKit::Mechanize
  • Win32::IE::Mechanize
  • WWW::Mechanize::Firefox
  • WWW::Scripter
  • WWW::Selenium.

For more information see WWW::Mechanize::FAQ.



来源:https://stackoverflow.com/questions/12655231/cant-use-perl-wwwmechanize-to-tick-checkboxes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!