1

I'm dealing with a website which is using Incapsula firewall protection which i think that's detected selenium as a robot behavior.

Here's my code run-online:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import sleep


def main(url):
    driver = webdriver.Firefox()
    driver.get(url)
    WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.CSS_SELECTOR, "#location"))).send_keys("06037")
    WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.CSS_SELECTOR, ".action-btn"))).click()
    WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.CSS_SELECTOR, "li.gs-option:nth-child(2) > a:nth-child(1) > div:nth-child(2)"))).click()
    WebDriverWait(driver, 10).until(
        EC.presence_of_all_elements_located((By.CSS_SELECTOR, "button[class^=sc]")))[2].click()
    driver.execute_script("window.scrollBy(0,400)")
    sleep(0.01)
    WebDriverWait(driver, 10).until(
        EC.presence_of_all_elements_located((By.CSS_SELECTOR, "img.img")))[1].click()
    WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.CSS_SELECTOR, "button[data-test-id='PrimaryCare']"))).click()
    WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.CSS_SELECTOR, "button[data-test-id$='AllPrimaryCareProviders']"))).click()


main("https://connect.werally.com/county-plan-selection/uhc.mnr/zip")

The current output: is a blank white page

enter image description here

Expected output as normal browser behavior:

enter image description here

  • 1
    https://stackoverflow.com/questions/56528631/is-there-a-version-of-selenium-webdriver-that-is-not-detectable/56529616#56529616 This suggests a few ways. – Abhishek Rai Nov 16 '20 at 07:06
  • Check the discussion [Can a website detect when you are using selenium with chromedriver?](https://stackoverflow.com/questions/33225947/can-a-website-detect-when-you-are-using-selenium-with-chromedriver/62520191#62520191) as well – undetected Selenium Nov 16 '20 at 11:00

0 Answers0