The main idea here is to pass a valid User-Agent string instead of using a generator object, and also tweak the browser fingerprint settings to avoid the bot check. First, you need to replace the cyclic object created by itertools.cycle
with a random selection of a single User-Agent string (e.g., using random.choice(user_agents)
). Make sure SeleniumBase is set up with the correct browser binary path and anti-automation options when initializing. If you’re still being detected, try it with selenium-stealth
module and clear the browser fingerprint data to keep each session independent.