I\'ve written a script in python in combination with selenium to parse some dates available within a table in a webpage. The table is located under the header NPL Vict
Try to use below code:
def get_content(driver,url):
driver.get(url)
dates = len(wait.until(EC.presence_of_all_elements_located((By.CSS_SELECTOR,"#tournamentTable tr.center.nob-border"))))
for d in range(dates):
item = driver.find_elements_by_css_selector("#tournamentTable tr.center.nob-border")[d]
try:
idate = item.find_element_by_css_selector("th span[class^='datet']").text
except Exception: idate = ""
for time_td in item.find_elements_by_xpath(".//following::td[contains(@class, 'table-time') and not((preceding::tr[@class='center nob-border'])[%d])]" % (d + 2)):
try:
itime = time_td.text
except Exception: itime = ""
print(f'{idate}--{itime}')