Closed Tmdoofking closed 2 years ago
Can you add some more detail to this can you add:
The problem may be due to slow internet connection you could fix this by:
If the problem is internet connection I will add a Check for the element soon.
this is from click login buttom (first one) i have let it loop alrerady, only way to fix it's reopen firefox. (i don't know how force finish it and restart from top)
Hi, it seems that the issue was the xpath of the login button switched between two different values seemingly at random the code for the fix is below and will also be commited to the main project files,
# Clicks login button
while True:
try:
driver.find_element(By.XPATH, '/html/body/div[1]/div/div[2]/nav/div/div[3]/div[2]/div/div[1]/div[1]/button')
login_xpath = '/html/body/div[1]/div/div[2]/nav/div/div[3]/div[2]/div/div[1]/div[1]/button'
break
except:
try:
driver.find_element(By.XPATH, '/html/body/div[1]/div/div[2]/nav/div/div[3]/div[3]/div/div[1]/div[1]/button')
login_xpath = '/html/body/div[1]/div/div[2]/nav/div/div[3]/div[3]/div/div[1]/div[1]/button'
break
except:
sleep(1)
driver.find_element(By.XPATH, login_xpath).click()
If this fixes your problem please close the issue.
(i don't know how force finish it and restart from top)
To close the current firefox instance run
driver.quit()
return None
Just in case you want to modify the project and need to.
driver.find_element(By.XPATH, '/html/body/div[1]/div/div[2]/nav/div/div[3]/div[3]/div/div[1]/div[1]/button').click() this event sometime won't work