Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在Selenium中执行操作后从每个url打印不同的列表。?_Python_List_Selenium - Fatal编程技术网

Python 如何在Selenium中执行操作后从每个url打印不同的列表。?

Python 如何在Selenium中执行操作后从每个url打印不同的列表。?,python,list,selenium,Python,List,Selenium,我需要的是每次选择页面上下一个按钮时打印元素列表,当我运行代码时,它会打印相同的列表五次。当我一个接一个地放置元素时,效果很好,但我需要完整的列表发送到csv。请帮忙 from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from threading import Timer import csv PATH = '/home/noir0319/geckodr

我需要的是每次选择页面上下一个按钮时打印元素列表,当我运行代码时,它会打印相同的列表五次。当我一个接一个地放置元素时,效果很好,但我需要完整的列表发送到csv。请帮忙

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from threading import Timer
import csv

PATH = '/home/noir0319/geckodriver'
driver = webdriver.Firefox(executable_path=PATH)

driver.get('https://sjf.scjn.gob.mx/SJFSist/Paginas/DetalleGeneralV2.aspx?Epoca=1e3000000000000&Apendice=1000000000000&Expresion=a&Dominio=Rubro,Texto&TA_TJ=1&Orden=1&Clase=DetalleTesisBL&NumTE=4906&Epp=20&Desde=-100&Hasta=-100&Index=0&InstanciasSeleccionadas=6,1,2,50,7&ID=2022260&Hit=1&IDs=2022260,2022286,2022273,2022272,2022279,2022285,2022287,2022288,2022289,2022310,2022311,2022263,2022299,2022312,2022303,2022235,2022236,2022237,2022238,2022245&tipoTesis=&Semanario=1&tabla=&Referencia=&Tema=')
boton = driver.find_element_by_class_name('boton_navegacion.siguiente')
lista_titulo = ['Tesis', 'Tribunal', 'Fecha', 'Epoca', 'Ubicacion', 'Id', 'Rubro', 'Cuerpo', 'Precedentes'],

#-------------------------------------------------------------------------

TESIS = driver.find_element_by_id('lblTesisBD').text
TRIBUNAL = driver.find_element_by_id('lblInstancia').text
FECHA = driver.find_element_by_id('lblLocMesAño').text
EPOCA = driver.find_element_by_id('lblEpoca').text
UBICACION = driver.find_element_by_id('lblLocPagina').text
ID = driver.find_element_by_id('lblIUS_ID').text
RUBRO = driver.find_element_by_id('lblRubro').text
CUERPO = driver.find_element_by_id('lblTexto').text
PRECEDENTES = driver.find_element_by_id('lblPrecedentes').text



datos = [TESIS, TRIBUNAL, FECHA, EPOCA, UBICACION, ID, RUBRO, CUERPO, PRECEDENTES]


actions = ActionChains(driver)
actions.click(boton).pause(1)


for i in range(5):
    print(datos)
    actions.perform()