2

I try to automate some steps using selenium, but when getting the URL the server rejected the request, here is my argument

opts = Options()
opts.add_argument("user-agent="+getRandomeUserAgent())
opts.add_experimental_option('prefs', {'intl.accept_languages': 'en,ar;q=0.9,en-US;q=0.8'})
opts.add_argument("--enable-javascript")
opts.add_argument("--enable-cookies")
opts.add_argument("--disable-blink-features")
opts.add_argument("--disable-blink-features=AutomationControlled")
opts.add_argument('--disable-extensions')
opts.add_argument("--no-sandbox")
opts.add_argument("--disable-dev-shm-usage")
opts.add_experimental_option('excludeSwitches', ['enable-automation'])

driver = webdriver.chrome.webdriver.WebDriver( chromrdriverPath, options=opts)
driver.set_page_load_timeout(timeout)
driver.get(URL)

it works fine when using the normal browser (not-automated) when sending the HTTP request, the site receives the request and redirects it to another page to check the browser if detected, refuse the request, and if not detected redirect to WantedPage. What are techniques should I follow to treat with that?

moro clash
  • 199
  • 1
  • 2
  • 6

0 Answers0