是否可以使用Selenium WebDriver来驱动PhantomJS? [英] Is it possible to use Selenium WebDriver to drive PhantomJS?

查看:104
本文介绍了是否可以使用Selenium WebDriver来驱动PhantomJS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读Selenium WebDriver的文档,例如,它可以驱动Chrome.我当时在想,驱动" PhantomJS效率会更高吗?

I’m going through the documentation for the Selenium WebDriver, and it can drive Chrome for example. I was thinking, wouldn't it be far more efficient to ‘drive’ PhantomJS?

是否可以将Selenium与PhantomJS一起使用?

Is there a way to use Selenium with PhantomJS?

我的预期用途是Web抓取:我抓取的网站上加载了AJAX和许多漂亮的JavaScript,我认为此设置可以很好地替代我目前正在使用的Scrapy Python框架.

My intended use would be web scraping: The sites I scrape are loaded with AJAX and lots of lovely JavaScript, and I’m thinking this setup could be a good replacement for the Scrapy Python framework that I’m currently working with.

推荐答案

PhantomJS现在包括 GhostDriver项目

PhantomJS now includes the GhostDriver project.

还建议您直接使用PhantomJS或与便捷库(例如 CasperJS )一起使用. CasperJS经过专门设计,可以轻松地对网页进行顺序操作,非常适合许多自动化任务.

You are also suggested to use PhantomJS directly or with a convenience library such as CasperJS. CasperJS is specifically designed to make it easy to do sequential operations to web pages, perfect for many automation tasks.

免责声明:我是PhantomJS的作者.

Disclaimer: I am the author of PhantomJS.

编辑:如尼克的回答所述,PhantomJS现在包含了GhostDriver.

Edit: As noted in Nick's answer, GhostDriver is now included in PhantomJS.

这篇关于是否可以使用Selenium WebDriver来驱动PhantomJS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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