Search code examples
pythonweb-scrapinguser-agent

No browsers version found for Chrome


I was using code which I took from internet for scraping amazon. I got first error of 'Maximum amount of retry reached' I read that need to modify useragent credentials in some places. I modified to ;

ua = UserAgent(use_cache_server=False,verify_ssl=False)
uag_random = ua.random

header = {
    'User-Agent': ua.chrome,
    'Accept-Language': 'en-US,en;q=0.9'
}

And now, it gives an error No browsers version found for Chrome I have no idea how to fix?

EDIT As I got into error in util.py it searches for browsers. And cannot find chromedriver.exe file ( I thought similarity with selenium webdriver) . And as code is from internet, I could not find where to put useragent fake to search for browser.

for browser in browsers_iter:
    if 'more' in browser.group(1).lower():
        continue

    browsers.append(browser.group(1))

EDIT2: I am trying to guess that request library get method tries to reach browser but is unable. The error is due that


Solution

  • You should read the docs again because there are no ua.random.chrome so if you want its random for google chrome you could try this code

    ua = UserAgent(use_cache_server=False,verify_ssl=False)
    
    header = {
        'User-Agent': ua['google chrome'],
        'Accept-Language': 'en-US,en;q=0.9'
    }