跳转到主要内容

用于与Google Chrome远程shell端口通信的客户端

项目描述

此库使得从Python与Google Chrome远程调试shell通信变得容易。为了使shell可用,使用以下选项启动Chrome

google-chrome --remote-shell-port=9222

然后您可以通过以下代码从Python进行连接

>>> import chrome_remote_shell
>>> shell = chrome_remote_shell.open(port=9222)
>>> shell.request('DevToolsService', command='ping')
{u'data': u'ok', u'command': u'ping', u'result': 0}

该协议的详细信息请参见

http://code.google.com/p/chromedevtools/wiki/ChromeDevToolsProtocol

作为便利,shell连接对象提供了一种方法,通过向第一个标签页注入JavaScript,命令Chrome在新标签页中打开一个URL

shell.open_url('http://www.aldaily.com/')

变更日志

2009年2月26日。 添加了有条件的导入 simplejson,以便在Python 2.5下运行模块。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源分发

chrome_remote_shell-1.2.tar.gz (2.1 kB 查看哈希值)

上传时间:

由以下支持