from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import csv
# 1.创建浏览器对象
#chrome版本较高,禁用GPU加速,否则一直报错
chrome_opt = webdriver.ChromeOptions()
chrome_opt.add_argument('--disable-gpu')
path = r"chromedriver.exe"
driver = webdriver.Chrome(executable_path=path,chrome_options=chrome_opt)
# 2.操作浏览器对象
driver.get('http://111111111/tx.aspx?fid=0')
#取出内容放入列表
def get_content():
list=[]
for i in range(2,30):
for s in range(1,10):
#遍历出xpath路径
str=f'//*[@id="form1"]/table/tbody/tr[{i}]/td[{s}]'
text=driver.find_element_by_xpath(str).text<