title: Scrape an Ajax form with .submit() with Python and Selenium
body: <p>I am trying to get the link from a web page. The web page sends the request using javascript, then the server sends a response which goes directly to download a PDF. This new PDF is automatically downloaded into your browser.
  My first approach was to use selenium to get the information:</p>
  <pre><code># Path chromedriver &amp; get url
  path = &quot;/Users/my_user/Desktop/chromedriver&quot;
  browser = webdriver.Chrome(path)
  browser.get(&quot;https://www.holzwickede.de/amtsblatt/index.php&quot;)
  
  # Banner click
  ban = WebDriverWait(browser,15).until(EC.element_to_be_clickable((By.XPATH,&quot;//a[@id='cc_btn_accept_all']&quot;))).click()
  
  #Element to get
  elem = browser.find_element_by_xpath(&quot;//div[@id='content']/div[7]/table//form[@name='gazette_52430']/a[@href='#gazette_52430']&quot;)
  elem.click()
  print (browser.current_url)
  </code></pre>
  <p>The result was the current URL which corresponds to the same webpage, while the request is directly to the server.</p>
  <pre><code>https://www.holzwickede.de/amtsblatt/index.php#gazette_52430
  </code></pre>
  <p>I tried after this unsuccessful result to grab it with requests.</p>
  <pre><code> # Access requests via the `requests` attribute
   for request in browser.requests: #It captures all the requessin chronologica order
       if request.response.headers:
           print(
               request.path,
               request.response.status_code,
               request.response.headers,
              request.body,
              &quot;/n&quot;
  
          )
  </code></pre>
  <p>The result stills not the behind link from which the PDF is coming.
  Do you guys have an idea what can I do ?
  Thanks in advance.</p>