我尝试使用一些Python网络爬虫从一个网站下载大约3000个pdf文件。但是,这些pdf的url是由JavaScript函数生成的。所以,我想知道有没有关于如何实现这一点的教程?在
例如,链接到Alberto European Hairspray (Aerosol) - All Variants的URL将在单击οnclick="javascript:__doPostBack('ctl00$placeBody$gridView$gridView','DocumentCenter.aspx?did={0}$0'后生成。
所以问题是如何让网络爬虫获得计算出的URL。在function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
Alberto European Hairspray (Aerosol) - All VariantsUnilever PLC8131-01 Alberto European Mousse (Aerosol) - All VariantsUnilever PLC8132-01