HotJar suspicious UserAgent error, nothing on google, Trying to run a python scraper tool for sports odds tracking

Viewed 2711

c:\Users\Administrator\Downloads\cloudbet(2).py:47: DeprecationWarning: use options instead of chrome_options driver = webdriver.Chrome(chrome_options=chrome_options, executable_path=r"C:\Python\Python38\Scripts\chromedriver.exe")

DevTools listening on ws://127.0.0.1:54368/devtools/browser/77f2d50d-65c6-49bf-af5b-7923f3d40bfc [0619/100243.424:INFO:CONSOLE(109)] "Hotjar not launching due to suspicious userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/84.0.4147.56 Safari/537.36", source: https://www.cloudbet.com/static/js/2.08e072ab.chunk.js (109)

2 Answers

I have faced same issue "with some websites". It was related to running Google Chrome webdriver in headless mode and that is showing in your post details.

"Hotjar not launching due to suspicious userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/84.0.4147.56 Safari/537.36"

The following options could help in resolving the issue:

  • Running Chrome driver in normal mode instead of headless. Namely, remove chrome_options.add_argument("--headless") option.
  • Running Chrome driver in headless mode, but bypass the auto generated user-agent with a normal-mode user agent by adding the following argument (as an example of that scenario) :
    userAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.56 Safari/537.36"
    chrome_options.add_argument(f'user-agent={userAgent}')
  • Try using headless Firefox instead.

there is a Cloudbet Odds API available under https://docs.cloudbet.com/ that should make it easier to access odds.

Is there anything missing that you're looking for?

Related