0

I have a code for making temp mail automatically but I have a problem.

This is code:

    import time
    from selenium import webdriver

    browser = webdriver.Chrome()
    browser.get("https://temp-mail.org/")
    time.sleep(10)
    browser.close()

The link opens correctly but I can't pass cloudflare.

img

Also, I see some errors on my console:

img

Thanks...

hyper-neutrino
  • 5,272
  • 2
  • 29
  • 50

1 Answers1

0

Try adding user agent argument in chrome options and set user agent to any value

ops = Options()
ua='me'
ops.add_argument('--user-agent=%s' % ua)  
driver=uc.Chrome(executable_path=r"C:\chromedriver.exe",chrome_options=ops)

Alternatively try using undetected-chromedriver

import undetected_chromedriver as uc
from selenium import webdriver

options = webdriver.ChromeOptions() 
options.add_argument("start-maximized")
driver = uc.Chrome(options=options)
driver.get("https://temp-mail.org/")
Prophet
  • 32,350
  • 22
  • 54
  • 79
  • I tried but i got this error: SyntaxError: invalid syntax. How can i apply this to my code? can u help me pls – dasdasddas dsadasd Jul 21 '21 at 12:15
  • I installed and applied code but it doesn't work :( same issue... – dasdasddas dsadasd Jul 21 '21 at 12:21
  • Strange. Here https://stackoverflow.com/questions/64842858/selenium-app-redirect-to-cloudflare-page-when-hosted-on-heroku and here https://stackoverflow.com/questions/67341346/how-to-bypass-cloudflare-bot-protection-in-selenium these solutions looks like working – Prophet Jul 21 '21 at 12:22
  • Try this https://stackoverflow.com/questions/64165726/selenium-stuck-on-checking-your-browser-before-accessing-url as well – Prophet Jul 21 '21 at 12:25
  • 3
    Doesn't work :/ i will search other methods to bypass cloudfire... – dasdasddas dsadasd Jul 21 '21 at 12:33