Website blocking Selenium : is there a way to bypass?

后端 未结 2 1095
暖寄归人
暖寄归人 2021-01-29 13:11

This webpage opens fine manually, but directly goes to a \"maintenance\" error message when using Selenium !

from selenium import webdriver
driver = webdriver.Ch         


        
2条回答
  •  执念已碎
    2021-01-29 13:42

    A bit unclear why you felt website blocking Selenium. However I was able to access the website following the solution below:

    • Code Block:

      from selenium import webdriver
      from selenium.webdriver.support.ui import WebDriverWait
      from selenium.webdriver.common.by import By
      from selenium.webdriver.support import expected_conditions as EC
      
      options = webdriver.ChromeOptions() 
      options.add_argument("start-maximized")
      options.add_experimental_option("excludeSwitches", ["enable-automation"])
      options.add_experimental_option('useAutomationExtension', False)
      driver = webdriver.Chrome(options=options, executable_path=r'C:\WebDrivers\chromedriver.exe')
      
      driver.get('https://www.winamax.fr/paris-sportifs/')
      WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "section#above-content a[href='/paris-sportifs']")))
      print(driver.page_source)
      
    • Console Output:

      
          Paris Sportifs - Parier en ligne avec Winamax
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
      
          
          
          
          

提交回复
热议问题