直接上代码
import selenium
from selenium import webdriver
import os,requests,time
import sys
from config import weizhi,urldef,Light_truck,Medium_truck,Heavy_truck,Dump_truck,truck,tag, pagenum,package_path,file_path
reload(sys)
sys.setdefaultencoding('utf8')
def start():
options = webdriver.ChromeOptions()
options.add_argument("--headless")
options.add_argument("--disable-gpu")
d = webdriver.Chrome(options=options)
return d
d = start()
def stop():
d.quit()
def query_write(path):
commont = d.find_element_by_xpath(weizhi['heard'] + str(count) + weizhi['common'])
start = d.find_element_by_xpath(weizhi['heard'] + str(count) + weizhi['startdate'])
end = d.find_element_by_xpath(weizhi['heard'] + str(count) + weizhi['enddate'])
huifu = d.find_element_by_xpath(weizhi['heard'