将chrome扩展与phantomjs集成 [英] Integrate chrome extensions with phantomjs

查看:150
本文介绍了将chrome扩展与phantomjs集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过phantomjs安装chrome扩展(.crx)?

Is there a way we can install chrome extensions (.crx) with phantomjs?

我的任务是将 adblockplus 与phantomjs集成在一起,以便我可以过滤所有广告网址和使用phantomjs报告.

My task here is to integrate adblockplus with phantomjs so that I can filter all the ad-urls and report using phantomjs.

还是将 adblockplus 扩展名与phantomjs集成的其他方式?

Or any other way to integrate the adblockplus extension with phantomjs?

推荐答案

PhantomJS基于三年的WebKit分支(QtWebKit),而不是Chromium.因此,您无法在PhantomJS中加载Chrome扩展程序.

PhantomJS is based on a three-year old WebKit fork (QtWebKit), not Chromium. Therefore you cannot load Chrome extensions in PhantomJS.

如果您想以自动方式使用Chrome扩展程序,建议您使用 ChromeDriver 来自Selenium WebDriver项目.

If you want to use Chrome extensions in an automated way, I suggest to use the ChromeDriver from the Selenium WebDriver project.

这篇关于将chrome扩展与phantomjs集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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