无法使用python、selenium和phantomjs捕获浏览器日志

2024-04-19 08:09:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直在研究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)中尝试同样的代码时,它有yoctolinux。 我有一个错误

^{pr2}$

有谁能帮助我或指导我在这个过程中出了什么问题吗。 我使用python=2.7, phantomjs=1.9.0硒=3.9

我的最终目标是捕获浏览器的控制台日志,任何其他的方法都会很有帮助,我在raspberry pi中得到了所需的输出,但我被困在了toradex板上,其中有yocto。在


Tags: 代码fromimporthttpgetdriverselenium错误