mardi 8 août 2023

Checkbox checking snag

https://irsa.ipac.caltech.edu/workspace/TMP_8Mcy38_15422/Gator/irsa/19142/tbview.html

I cannot select the checkboxes on this page using selenium webdriver.

This is an excerpt from the code I'm using:

import pandas as pd
import matplotlib.pyplot as plt
import csv
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import os
import shutil

     driver_path = 'C:/Windows/chromedriver.exe'
     driver = webdriver.Chrome(executable_path=driver_path)
     driver.get('https://irsa.ipac.caltech.edu/cgi-bin/Gator/nph-scan?mission=irsa&submit=Select&projshort=ZTF')

     driver.find_element_by_xpath("//input[@value='ztf_objects_dr18']").click()
     driver.find_element_by_xpath("//input[@value='Select']").click()

     driver.find_element_by_name('objstr').send_keys(str(177.18609)+' '+str(21.47316))

     driver.find_element_by_xpath("//input[@value='10']").clear()
     driver.find_element_by_xpath("//input[@value='10']").send_keys('2')

     # Generate Text File
     driver.find_element_by_xpath("//input[@value='Run Query']").click()

     # Click on Download Button
    import time
    #print('going to sleep')
    time.sleep(2)
    #print('woke up')
    driver.find_element_by_xpath("//input[@tabindex='-1']").click()

Result on running this

NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@tabindex='-1']"}



Aucun commentaire:

Enregistrer un commentaire