使用Javascript(和HTML渲染)引擎没有自动化的GUI? [英] Javascript (and HTML rendering) engine without a GUI for automation?

查看:265
本文介绍了使用Javascript(和HTML渲染)引擎没有自动化的GUI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有提供一个浏览器的功能,但并不需要实际的物理呈现在屏幕上?任何库或框架

Are there any libraries or frameworks that provide the functionality of a browser, but do not need to actually render physically onto the screen?

我想自动化网页上的导航(机械化做到这一点,例如),但我想整个浏览器的体验,包括JavaScript。因此,我想有某种形式的虚拟浏览器,我可以用它来点击链接编程,有DOM元素和JS脚本内渲染它,并操纵这些元素。

I want to automate navigation on web pages (Mechanize does this, for example), but I want the full browser experience, including Javascript. Thus, I'd like to have a virtual browser of some sort, that I can use to "click on links" programmatically, have DOM elements and JS scripts render within it, and manipulate these elements.

解决方案preferably在Python,但我可以管理他人。

Solution preferably in Python, but I can manage others.

推荐答案

PhantomJS PyPhantomJS 是什么我用这样的任务。

PhantomJS and PyPhantomJS are what I use for tasks like these.

它是什么,是一个无头WebKit的基于浏览器是通过JavaScript完全可控。有一个C ++实现(PhantomJS)和一个Python一(PyPhantomJS)。我preFER Python的人会想到,因为它有一个插件系统,让您无需实际修改任何code,不像C ++之一添加功能的核心。 :)

What it is, is a headless WebKit based browser which is fully controllable via JavaScript. There's a C++ implementation (PhantomJS) and a Python one (PyPhantomJS). I prefer the Python one though, because it has a plugin system which allows you to add functionality to the core without actually modifying any code, unlike the C++ one. :)

这篇关于使用Javascript(和HTML渲染)引擎没有自动化的GUI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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