环境测试
from selenium import webdriver
chromedriver_path = r"C:\Program Files\Google\Chrome\Application\chromedriver.exe"
driver = webdriver.Chrome()
url = "https://www.xinpianchang.com/discover/article?from=navigator"
常用API
操作页面元素
from selenium import webdriver
driver = webdriver.Chrome()
url = "https://passport.xinpianchang.com/login?redirect_uri=https%3A%2F%2Fwww.xinpianchang.com%2Fuser%2F14226548&mode=quick&type=phone"
with open(r"C:\Users\lenovo\Desktop\a.txt", 'r', encoding='utf-8') as rStream:
replace = read.replace("'", '"').replace("True", "true").replace("False", "false").replace("Null", "null")
with open(r"", 'w', encoding='utf-8') as wStream:
write = wStream.write(replace)
with open(r"", 'r', encoding='utf-8') as rStream:
driver.get("https://www.xinpianchang.com/")