大约两个月前,我是编程新手,并开始使用Python ,并且正在通过使用Python文本自动化烦人的东西 。 我正在使用IDLE,并已安装selenium模块和Firefox浏览器。 每当我试图运行webdriverfunction,我得到这个: from selenium import webdriver browser = webdriver.Firefox() 例外: – Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x00000249C0DA1080>> Traceback (most recent call last): File "C:\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 163, in __del__ self.stop() File "C:\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 135, in stop if self.process is None: AttributeError: 'Service' object has no attribute 'process' Exception […]
我在EC2实例。 所以没有GUI。 $pip install selenium $sudo apt-get install firefox xvfb 然后我这样做: $Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null & $DISPLAY=:1 java -jar selenium-server-standalone-2.0b3.jar 05:08:31.227 INFO – Java: Sun Microsystems Inc. 19.0-b09 05:08:31.229 INFO – OS: Linux 2.6.32-305-ec2 i386 05:08:31.233 INFO – v2.0 [b3], with Core v2.0 [b3] 05:08:32.121 INFO – RemoteWebDriver instances should connect to: […]