chrome_remote_shell是一個庫,可以很容易與谷歌Chrome遠程調試外殼從Python的溝通與NBSP;為了使外殼可用,Chrome瀏覽器開始使用此選項:
谷歌鉻--remote殼口= 9222
然後你就可以用Python通過這樣的代碼連接:
>>>進口chrome_remote_shell
>>>殼= chrome_remote_shell.open(端口= 9222)
>>> shell.request('DevToolsService',命令='平')
{u'data“:u'ok',u'command”:u'ping',u'result':0}
該協議是在詳細地描述:
http://code.google.com/p/chromedevtools/wiki/ChromeDevToolsProtocol
為方便起見,外殼連接對象提供的方法,通過注射到JavaScript的第一個選項卡,Chrome瀏覽器的命令在新標籤中打開一個URL:
shell.open_url('http://www.aldaily.com/')
Requirements:
- Python
- 谷歌Chrome瀏覽器
評論沒有發現