title: XHR request getting blocked and showing HTTP status code 405 with Python Selenium
body: <p>Hi I am new to Selenium based automation. I am trying to load a page in Selenium with Python. But the website is blocking me. </p>
  
  <p>They are sending XHR request to the site and redirecting based on the response. This works properly with manual process, i.e. manually putting in the ZIP code and selecting a pickup location. But when I try the same using Selenium driver its throwing 405 status code. </p>
  
  <p>I went through few searches and they are asking to disable CORS in selenium, but that as well returns the same status code. </p>
  
  <p>Is there any way I can handle CORS in selenium drivers?</p>
  
  <pre><code>from selenium import webdriver
  options = webdriver.ChromeOptions()
  options.add_argument("start-maximized")
  options.add_argument("disable-infobars")
  options.add_argument("--disable-extensions")
  # options.add_argument("--disable-web-security") &lt;-- tried disabling CORS for selenium
  
  driver = webdriver.Chrome("/path/to/chromedriver", chrome_options=options)
  
  driver.get("https://www.peapod.com/")
  enter_zip = driver.find_element_by_css_selector("#zipInput--top")
  enter_zip.send_keys("60412")
  submit_button = driver.find_element_by_css_selector("#guest-form--top &gt; div.gateway-login_input-container &gt; div &gt; label &gt; div.gateway-login_button-container &gt; button")
  
  submit_button.click()  
  
  time.sleep(5)
  
  # selecting the first location slot
  location_selection = driver.find_element_by_css_selector(".location_select &gt; button")
  location_selection.click()  &lt;-- this is the place it is getting blocked and throwing 405 status code
  </code></pre>
  
  <p>Is there any way to get past this or is there any JavaScript running which detects the browser type? Any help would be great. </p>