can';t使用python、selenium和phantomjs捕获浏览器日志

can';t使用python、selenium和phantomjs捕获浏览器日志,python,selenium,selenium-webdriver,phantomjs,yocto,Python,Selenium,Selenium Webdriver,Phantomjs,Yocto,我一直在研究Python、Selenium和phantomjs,我遇到了错误 from selenium import webdriver driver = webdriver.PhantomJS() driver.get('http://google.com') for entry in driver.get_log('browser'): print entry 这是我正在使用的示例代码,问题是它在ubuntu和raspberry pi中工作得非常好,但是当我在Toradex bo

我一直在研究Python、Selenium和phantomjs,我遇到了错误

from selenium import webdriver
driver = webdriver.PhantomJS()
driver.get('http://google.com')
for entry in driver.get_log('browser'):
    print entry
这是我正在使用的示例代码,问题是它在ubuntu和raspberry pi中工作得非常好,但是当我在Toradex borad(T30)中尝试相同的代码时,它有yocto linux。 我得到一个错误声明

File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 1238, in get_log
    return self.execute(Command.GET_LOG, {'type': log_type})['value']   
File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
    self.error_handler.check_response(response)   File "/usr/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 208, in check_response
    raise exception_class(value) 
selenium.common.exceptions.WebDriverException: Message: Invalid Command Method - Request => {"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"71","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:42648","User-Agent":"Python http auth"},"httpVersion":"1.1","method":"POST","post":"{\"sessionId\": \"db7d3690-6a59-11e8-bf9a-d526e0e5f7cd\", \"type\": \"server\"}","url":"/log","urlParsed":{"anchor":"","query":"","file":"log","directory":"/","path":"/log","relative":"/log","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/log","queryKey":{},"chunks":["log"]},"urlOriginal":"/session/db7d3690-6a59-11e8-bf9a-d526e0e5f7cd/log"}
谁能帮助我或指导我在这个过程中哪里出了问题。 我使用的是python=2.7, phantomjs=1.9.0和selenium=3.9


我的最终目标是捕获浏览器的控制台日志。任何其他方法都会非常有用,我在raspberry pi中获得了所需的输出,但我在toradex板中卡住了,该板中有yocto。

为了更好地测试,请不要使用
谷歌
@zimdero感谢您的快速响应,我尝试了不同的站点进行测试,每次我都会遇到与
无效命令方法相同的错误