Website using DataDome gets captcha blocked while scraping using Selenium and Python

前端 未结 2 1623
猫巷女王i
猫巷女王i 2020-12-12 04:10

I\'m actually trying to scrape some car datas from different websites, i\'ve been using selenium with chromebrowser but some websites actually block selenium with captcha va

2条回答
  •  遥遥无期
    2020-12-12 04:54

    A bit more details about your usecase on scraping car datas from different websites or from https://www.leboncoin.fr/ would have helped us to construct a more canonical answer. However, I was able to access the Page Source using Selenium as follows:

    • Code Block:

      from selenium import webdriver
      
      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.leboncoin.fr/')
      print(driver.page_source)
      
    • Console Output:

      
      
                                       
                    
提交回复
热议问题