0

I am trying to access a site using selenium Python. But the site is checking and checking continuously by cloudflare. No other page is coming.

Check the screenshot here.

enter image description here

I have tried undetected chrome but it is not working at all.

JamesHorab
  • 11
  • 2

1 Answers1

1

By undetected chrome do you mean undetected chromedriver?:

Anyways, undetected-chromedriver works for me:

Undetected chromedriver

Github: https://github.com/ultrafunkamsterdam/undetected-chromedriver

pip install undetected-chromedriver

Code that gets a cloudflare protected site:

import undetected_chromedriver as uc
driver = uc.Chrome(use_subprocess=True)
driver.get('https://nowsecure.nl')

My POV

enter image description here enter image description here


Quick setup code that logs into your google account:

Github: https://github.com/xtekky/google-login-bypass

import undetected_chromedriver as uc
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

#  ---------- EDIT ----------
email = 'email\n' # replace email
password = 'password\n' # replace password
#  ---------- EDIT ----------

driver = uc.Chrome(use_subprocess=True)
wait = WebDriverWait(driver, 20)
url = 'https://accounts.google.com/ServiceLogin?service=accountsettings&continue=https://myaccount.google.com%3Futm_source%3Daccount-marketing-page%26utm_medium%3Dgo-to-account-button'
driver.get(url)


wait.until(EC.visibility_of_element_located((By.NAME, 'identifier'))).send_keys(email)
wait.until(EC.visibility_of_element_located((By.NAME, 'password'))).send_keys(password)
print("You're in!! enjoy")

# [ ---------- paste your code here ---------- ]
xtekky
  • 228
  • 1
  • 10
  • Hi, Thanks, but like I said undetected-chromedriver is not working on me. I have checked again. – JamesHorab Mar 17 '22 at 20:31
  • Check: https://stackoverflow.com/questions/56528631/is-there-a-version-of-selenium-webdriver-that-is-not-detectable you may find an answer there or https://blog.m157q.tw/posts/2020/09/11/bypass-cloudflare-detection-while-using-selenium-with-chromedriver/ – xtekky Mar 17 '22 at 20:39
  • 1
    @xtekky [undetected_chromedriver v1](https://stackoverflow.com/a/65534593/7429447) as of today appears vulnerable and we are still working to integrate [_`undetected_chromedriver`_](https://stackoverflow.com/a/66200459/7429447) with Selenium v4.x – undetected Selenium Mar 17 '22 at 21:46