Mac selenium添加chromedriver.exe

直说重要的,Win下配置selenium的环境很简单,添加webdriver也一样,下面说一说如何在Mac下配置webdriver(主要针对Chrome,其他应该也大同小异,思想最重要)

直接上代码:

from selenium import webdriver
import time

#executable_path的值为你的webdriver的具体路径
browser = webdriver.Chrome(executable_path = '/Users/xxx/Downloads/chromedriver')

browser.get("htpp://www.baidu.com")

print 'success'

time.sleep(3)

browser.quit()


具体见知乎:https://zhuanlan.zhihu.com/p/25236838


猜你喜欢

转载自blog.csdn.net/qq_21205435/article/details/78565535