ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)

Home Page:https://github.com/UltrafunkAmsterdam/undetected-chromedriver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[nodriver] support how to set timezone?

gouravkumar99 opened this issue · comments

`async def setIP(self):
self.tab = await self.browser.get('https://ipinfo.io/json')
self.tab.evaluate("document.documentElement.outerHTML;",return_by_value=True,await_promise=True)

    timezone = str(checkout_page_data.split('"timezone": "')[1].split('"')[0])        
    cdp.emulation.set_timezone_override(timezone_id=timezone)
    latlong = str(checkout_page_data.split('"loc": "')[1].split('"')[0]).split(",")
    cdp.emulation.clear_geolocation_override()
    cdp.emulation.set_geolocation_override(latitude=float(latlong[0]),longitude=latlong[1],accuracy=100)
    
    time.sleep(5)
    self.tab = await self.browser.get('https://www.browserscan.net/')
    print()`
    
 I am using this code but it is not working.