标签:odi 安装 用户 quit storage find utf-8 drive end
#!/usr/bin/python3 #coding:utf-8 from selenium import webdriver #下面填入用户名以及密码 up={"ue":"admin","pd":"YXZC@ECQ.Test"} chromedriver = "D:\\chromedriver.exe" chrome=webdriver.Chrome(chromedriver) chrome.get(url="http://www.ceshi.com/") # chrome.find_element_by_xpath("//*[@id=\"loginDiv\"]/div/div[1]/div/div[2]/a").click() User=chrome.find_element_by_id("username") User.clear() User.send_keys(jd_up["ue"]) Passwd=chrome.find_element_by_id("userPassword") Passwd.clear() Passwd.send_keys(jd_up["pd"]) chrome.find_element_by_id("loginbtn").click() chrome.get(url="http://www.ceshi.com/url") chrome.quit
chromedriver需要安装
http://chromedriver.storage.googleapis.com/index.html下载对应的版本
标签:odi 安装 用户 quit storage find utf-8 drive end
原文地址:https://www.cnblogs.com/haishashou/p/9140851.html