[英]Can't use perl WWW::Mechanize to tick checkboxes
I am making a webscraper using perl WWW::Mechanize. 我正在使用perl WWW :: Mechanize制作一个webscraper。 My problem is the site that I am scraping is using javascript a bit too much.
我的问题是,我要抓取的网站使用的JavaScript太多了。 I am logging in using credentials, Then traversing to custom search using
$mech->follow_link(url)
. 我使用凭据登录,然后使用
$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.
我登陆到一个页面,我必须从启用JavaScript的下拉列表中选择一个复选框和一个单选按钮。 I am stuck at this point.
我被困在这一点上。
The part of html is as below. html的部分如下。 When I am using
$mech->tick('cs-MajorIndustryGroup')
, I am getting an error 当我使用
$mech->tick('cs-MajorIndustryGroup')
时,出现错误
Can't call method "find_input" on an undefined value
WWW::Mechanize
doesn't support JavaScript. WWW::Mechanize
不支持JavaScript。 You could try some of these modules: 您可以尝试以下一些模块:
Gtk2::WebKit::Mechanize
Win32::IE::Mechanize
WWW::Mechanize::Firefox
WWW::Scripter
WWW::Selenium
. WWW::Selenium
。 For more information see WWW::Mechanize::FAQ
. 有关更多信息,请参见
WWW::Mechanize::FAQ
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.