Tal*_*ili 4 python security perl screen-scraping r
以下网址:
提供以色列政府提供的信息数据生成器,将一次提取的数据点数限制为最多50个系列.我想,是否有可能(如果是这样,如何)编写一个webscraper(用你最喜欢的语言/软件),它可以跟随每一步的点击,以便能够获得特定主题中的所有系列.
谢谢.
看看WWW :: Mechanize和WWW :: HtmlUnit.
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;
my $m = WWW::Mechanize->new;
#get page
$m->get("http://www.cbs.gov.il/ts/ID40d250e0710c2f/databank/series_func_e_v1.html?level_1=31&level_2=1&level_3=7");
#submit the form on the first page
$m->submit_form(
with_fields => {
name_tatser => 2, #Orders for export
}
);
#now that we have the second page, submit the form on it
$m->submit_form(
with_fields => {
name_ser => 1576, #Number of companies that answered
}
);
#and so on...
#printing the source HTML is a good way
#to find out what you need to do next
print $m->content;
Run Code Online (Sandbox Code Playgroud)