一、安装环境
# Python安装不在赘述
# Selenium安装: pip install selenium
# 还需要一个浏览器驱动(下载完后解压加入系统环境变量):
# Firefox: (https://github.com/mozilla/geckodriver/releases)
# Chrome: (https://sites.google.com/a/chromium.org/chromedriver/)
二、访问百度首页demo
browse = webdriver.Chrome(r'D:\dandan\test_selenium\test_1_demo\chromedriver.exe') # Declaration path
browse.get('http://www.baidu.com') # Load page
print(browse.title) # print title
原文链接:https://blog.csdn.net/qq_25046261/article/details/81744920