以下网址:
提供来自以色列政府的信息数据生成器,它将提取的数据点数量限制为一次最多 50 个系列。我想知道,是否有可能(如果可以,如何)编写一个网络爬虫(用您最喜欢的语言/软件),它可以跟踪每个步骤的点击,从而能够获取特定主题的所有系列。
谢谢。
最佳答案
看看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;
关于python - 如何从以色列统计局网络查询工具中抓取数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6429618/