I'm trying to get cookie values by undetected_chromedriver.v2. Here is my code:
import undetected_chromedriver.v2 as uc
driver = uc.Chrome()
with driver:
driver.get('https://thesite.com')
driver.implicitly_wait(10) #waits until page loads (but it works strange)
print(driver.get_cookies())
If I use time.sleep() instead if implicitly wait, the page loads only cloudflare page and endlessly reloads.
Browser opens. Then the site loads. And i see this:
But my code doesn't wait for completely loading and outputs:
[{'domain': 'thesite.com', 'expiry': 1621067731, 'httpOnly': False, 'name': 'cf_chl_prog', 'path': '/', 'secure': False, 'value': 'e'}]
Then the site finally loads and only now I'd like to get cookies.
What can I do?
P.S.: sorry for my bad english, i hope you understand me =)