Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How to use undetected_chromedriever with a token param?

$
0
0

Does anyone know how I could pass to the Chrome function of the python undetected_chromedriver (v3.5.5) module a parameter in the header with a token to use in a get request.Thanks in advance

I tried this but it failed me:

def init_webdriver(headless=False, token=None):    options = uc.ChromeOptions()    user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/122.0.0.0"    options.add_argument(f"user-agent={user_agent}")    options.add_argument(f"authorization={token}")    driver = uc.Chrome(headless=headless,options=options)    return driver

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>