Answer the question
In order to leave comments, you need to log in
How to bypass cloudflare bot protection?
I'm trying to access the site, but the site is protected from cloudflare bots
Here is the original code, the site gives an error
Checking your browser before accessing somesite
This process is automatic. Your browser will redirect to your requested content shortly.
Please allow up to 5 seconds…
from selenium import webdriver
browser = webdriver.Chrome(executable_path='/Users/ivanburylov/PycharmProjects/scraper/chromedriver')
url = 'https://somesite'
browser.get(url)
time.sleep(15)
browser.close()
browser.quit()
shutil.rmtree(self.user_data_dir, ignore_errors=False)
AttributeError: 'Chrome' object has no attribute 'user_data_dir'
import undetected_chromedriver.v2 as uc
driver = uc.Chrome(executable_path='/Users/ivanburylov/PycharmProjects/scraper/chromedriver')
url = 'https://somesite'
driver.get(url=url)
time.sleep(15)
driver.close()
driver.quit()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question