能够在 Windows 的 python 中解释 Javascript 的网络爬虫 [英] Web crawler capable of interpreting Javascript in python for Windows

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

问题描述

我的最终目标是构建一个能够下载网页上所有图像的网络爬虫.根据我所做的阅读,我的理解是我需要嵌入一个渲染/布局引擎,例如 Gecko 或 Webkit.

My ultimate goal is to build a web crawler capable of downloading all of the images on a webpage. My understanding from the reading I've done is that I need to embed a rendering/layout engine such as Gecko or Webkit.

不幸的是,我正在运行 Windows,所以 PyWebkit 已经出局 并且正在为 Gecko 或 Java 使用 Rhino 进行 C++ 的短期学习,我不知道该从哪里转向.

Unfortunately, I'm running windows, so PyWebkit is out and short learning C++ for Gecko or Java to use Rhino, I'm not sure where to turn.

是否有可在 Windows(64 位、Windows 7)中使用的带有 Python 绑定的可靠渲染引擎?有没有一种简单的方法可以在 Windows 上的 python 脚本中执行 javascript?

Is there a reliable rendering engine with python bindings that will work in windows (64-bit, Windows 7)? Is there an easy way to execute javascript within a python script on windows?

推荐答案

您不需要 Webkit 来执行此操作.你只需要一个引擎来运行 Javascript 代码,所以看看 Gogole V8Mozilla SpiderMonkey.

You don't need Webkit to do that. All you need it an engine to run Javascript code, so take a look at Gogole V8 or Mozilla SpiderMonkey.

如果您更喜欢 Python 来构建您的爬虫,您可能需要使用 PyV8因为它提供了所有必要的绑定.

If you're prefer Python to build your crawler, you may want to use PyV8 as it provides all necessary bindings.

这篇关于能够在 Windows 的 python 中解释 Javascript 的网络爬虫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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