我尝试在selenium
中使用python3
强制执行javascript
,然后使用html
返回/解析呈现的BeautifulSoup
。不幸的是,在尝试使用selenium
时,我很快就停止了。我这样做:
>>> import platform
>>> from selenium import webdriver
>>> browser = webdriver.Safari()
然后得到以下错误:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
browser = webdriver.Safari()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/safari/webdriver.py", line 48, in __init__
self.service.start()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 86, in start
self.assert_process_still_running()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 99, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service /usr/bin/safaridriver unexpectedly exited. Status code was: 1
你知道我做错了什么吗?