我正在尝试运行一个python脚本,在这个脚本中我打开一个网页并单击某个元素。但是脚本运行速度非常慢,并且随机出现异常。在
大多数时候它会停在队伍里 驱动程序=网络驱动程序Firefox()
消息-
selenium.common.exceptions.WebDriverException: Message: 'Can\'t load the profile. Profile ?Dir: /tmp/tmp4liaEq Firefox output: Xlib: extension "RANDR" missing on display ":1733".\n1403086712970\taddons.xpi\tDEBUG\tstartup\n1403086713204\taddons.xpi\tDEBUG\tcheckForChanges\n1403086713568\taddons.xpi\tDEBUG\tNo changes found\n'
有时-
driver.find_element_by_xpath("//a[@id='some_id']")
返回错误:元素不可见,因此无法单击。在
同样的脚本在我有4GB RAM的系统上运行得很顺利。 (EC2系统规格~ 600mb内存)
我试着查看系统,结果“top”命令返回-
604332k total, 577412k used, 26920k free, 6616k buffers
我已经安装了firefox和xvfb,因为我正在运行firefox的headless
我也面临同样的问题。 以root用户身份运行脚本解决了这个问题。 同时让一个运行测试的用户成为sudoer。在
相关问题 更多 >
编程相关推荐