1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| driver = webdriver.Chrome(r"/usr/bin/chromedriver”) ``` ##### 中应该是chromedrive.exe的路径 --- ### 2. ```python ====================================================================== ERROR: test_search_in_python_org (__main__.mytest) ---------------------------------------------------------------------- Traceback (most recent call last): File "mystyle.py", line 12, in test_search_in_python_org driver.get("www.baidu.com") File "/Users/zhangjia/anaconda/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 309, in get self.execute(Command.GET, {'url': url}) File "/Users/zhangjia/anaconda/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 297, in execute self.error_handler.check_response(response) File "/Users/zhangjia/anaconda/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: unhandled inspector error: {"code":-32000,"message":"Cannot navigate to invalid URL"} (Session info: chrome=61.0.3163.100) (Driver info: chromedriver=2.32.498537 (cb2f855cbc7b82e20387eaf9a43f6b99b6105061),platform=Mac OS X 10.12.6 x86_64) ---------------------------------------------------------------------- Ran 1 test in 1.896s FAILED (errors=1)
|