在Python中创建无头的Chrome实例 [英] Creating a headless Chrome instance in Python

查看:78
本文介绍了在Python中创建无头的Chrome实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题描述了我在研究可用Python创建无头Chrome实例的可用选项之后的结论,并要求进行确认或描述更好的方式"的资源.

This question describes my conclusion after researching available options for creating a headless Chrome instance in Python and asks for confirmation or resources that describe a 'better way'.

据我所见,在Python应用程序中使用无头Chrome实例入门的最快方法似乎是使用CEF(

From what I've seen it seems that the quickest way to get started with a headless instance of Chrome in a Python application is to use CEF (http://code.google.com/p/chromiumembedded/) with CEFPython (http://code.google.com/p/cefpython/). CEFPython seems premature though, so using it would likely mean further customization before I'm able to load a headless Chrome instance that loads web pages (and required files), resolves a completed DOM and then lets me run arbitrary JS against it from Python.

我是否错过了其他任何更成熟的项目,或者会让我更轻松?

Have I missed any other projects that are more mature or would make this easier for me?

推荐答案

您是否没有考虑过将Chrome驱动程序与Selenium结合使用?

Any reason you haven't considered Selenium with the Chrome Driver?

http://code.google.com/p/selenium/wiki/ChromeDriver

http://code.google.com/p/selenium/wiki/PythonBindings

这篇关于在Python中创建无头的Chrome实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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