Feb-24-2021, 11:14 AM
Hello,
I have this Selenium web scrapping project I've been working on for while, everything have been awesome till recently the website got updated and some Xpath values changed.
I updated the script to match the New Xpath values, everything went back to working as expected apart from one section.Here is the script
I have checked the Xpath countless times to a certain i have the right one, I have tried the Wait method but the problem remains.
![Click Photo To Enlarge İmage]()
Basically I want to get only the results of the first teams i.e 2:1 etc .
Kindly Help
I have this Selenium web scrapping project I've been working on for while, everything have been awesome till recently the website got updated and some Xpath values changed.
I updated the script to match the New Xpath values, everything went back to working as expected apart from one section.Here is the script
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 from selenium.common.exceptions import TimeoutException import time from selenium.webdriver.support.select import Select from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as ec from selenium.webdriver.common.action_chains import ActionChains from webdriver_manager.chrome import ChromeDriverManager driver = webdriver.Chrome(ChromeDriverManager().install()) driver.get("https://odibets.com/") time.sleep(8) userName = driver.find_element_by_xpath('/html/body/div[1]/div[1]/div[1]/div[1]/div[3]/div/div[3]/a/img') driver.execute_script("arguments[0].click();", userName) time.sleep(3) # navigate to League userName = driver.find_element_by_xpath('/html/body/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/ul/li[3]/a[2]/span[1]/img') driver.execute_script("arguments[0].click();", userName) time.sleep(6) #Go To Results userName = driver.find_element_by_xpath('/html/body/div[1]/div[1]/div/div[2]/div[1]/div[1]/ul[2]/li[2]/button') driver.execute_script("arguments[0].click();", userName) time.sleep(7) #check results in cell 1 resultA=driver.find_element(By.XPATH,'/html/body/div[1]/div[1]/div/div[2]/div[1]/div[2]/div[1]/div/div/div[1]/div/table/tr[2]/td[2]') #resultA=WebDriverWait(driver, 20).until(ec.visibility_of_element_located((By.XPATH, '/html/body/div[1]/div[1]/div/div[2]/div[1]/div[2]/div[1]/div/div/div[1]/div/table/tr[2]/td[2]'))) print (resultA.text) print ('Results')The part
print (resultA.text)does not print anything and doesn't throw any Error
I have checked the Xpath countless times to a certain i have the right one, I have tried the Wait method but the problem remains.
Basically I want to get only the results of the first teams i.e 2:1 etc .
Kindly Help