selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
将chromedriver.exe
复制到C:\Users\CWJ(你的电脑用户名)\AppData\Local\Programs\Python\Python37\Scripts
下面即可
测试程序:
from selenium import webdriver
import time
def main():
b = webdriver.Chrome()
b.get('https://www.baidu.com')
time.sleep(5)
b.quit()
if __name__ == '__main__':
main()
结果: