如何在 Perl 网络爬虫中处理 Javascript? [英] How can I handle Javascript in a Perl web crawler?

查看:27
本文介绍了如何在 Perl 网络爬虫中处理 Javascript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想抓取一个网站,问题是它充满了 JavaScript 的东西,比如按钮,当它们被按下时,它们不会改变 URL,但页面上的数据会改变.

I would like to crawl a website, the problem is, that its full of JavaScript things, such as buttons and such that when they are pressed, they do not change the URL, but the data on the page is changed.

我通常使用 LWP/Mechanize 等来抓取网站,但都不支持 JavaScript.有什么想法吗?

Usually I use LWP / Mechanize etc to crawl sites, but neither support JavaScript. any idea?

推荐答案

另一个选择可能是 SeleniumWWW::Selenium 模块

Another option might be Selenium with WWW::Selenium module

这篇关于如何在 Perl 网络爬虫中处理 Javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆