ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
9.57k stars 1.14k forks source link

url changes wait isnt waiting #995

Open ahmadkarimi4 opened 1 year ago

ahmadkarimi4 commented 1 year ago

WebDriverWait(driver, 10).until(EC.url_changes) this I used isnt waiting but when i used the same with selenium normal it was waiting to change

ManiMozaffar commented 1 year ago

worked fine. website usually redirects you automatically, which means for example you may go to https://google.com, but it actually goes to https://www.google.com. You can see the final url with driver.current_url.

import undetected_chromedriver as uc
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = uc.Chrome()
driver.get('https://www.google.com/')
final_url = driver.current_url
WebDriverWait(driver, 20).until(EC.url_changes("https://www.google.com/"))
## here go to another website from chrome, once you go it trigger the url changes.
print("Changed")