title: Python - Downloading PDFs from website behind dropdown
body: <p>For the site <a href="https://www.wsop.com/tournaments/results/" rel="nofollow noreferrer">https://www.wsop.com/tournaments/results/</a>, the objective is to download all available PDFs on the REPORTS section, behind all different drop down options where they are available.</p>
  <p>Currently I am trying to do this using selenium, because I couldn't find an api, but I am open to other suggestions. For now the code is a bunch of copy-paste from relevant questions and YT videos.</p>
  <p><strong>My plan of attack is to select an option in the drop-down menu, press 'GO' (to load them), navigate to 'REPORTS' (if available) and download all the PDFs available. And then iterate over all options. Challenge 2 is then to get the PDFs to something like a dataframe to do some analysis.</strong></p>
  <p>Below is my current code, that only manages to download the top PDF of the by default selected option in the drop-down:</p>
  <pre><code>from selenium import webdriver
  from webdriver_manager.chrome import ChromeDriverManager
  from selenium.webdriver.support.ui import Select
  from selenium.webdriver.chrome.options import Options
  import os
  
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support import expected_conditions as EC
  
  #settings and loading webpage
  options=Options()
  options.headless=True
  CD=ChromeDriverManager().install()
  
  driver=webdriver.Chrome(CD,options=options)
  
  params={'behavior':'allow','downloadPath':os.getcwd()+'\\PDFs'}
  driver.execute_cdp_cmd('Page.setDownloadBehavior',params)
  
  driver.get('https://www.wsop.com/tournaments/results/')
  
  #Go through the dropdown
  drp=Select(driver.find_element_by_id(&quot;CPHbody_aid&quot;))
  drp.select_by_index(0)
  
  drp=Select(driver.find_element_by_id(&quot;CPHbody_grid&quot;))
  drp.select_by_index(1)
  
  drp=Select(driver.find_element_by_id(&quot;CPHbody_tid&quot;))
  drp.select_by_index(5)
  
  #Click the necessary buttons (section with issues)
  driver.find_element_by_xpath('//*[@id=&quot;nav-tabs&quot;]/a[6]').click()
  
  #driver.find_element_by_name('GO').click()
  #WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.LINK_TEXT, &quot;GO&quot;))).click()
  
  #WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.LINK_TEXT, &quot;REPORTS&quot;))).click()
  
  a=driver.find_element_by_id(&quot;reports&quot;).click()
  </code></pre>
  <p>I can navigate through the drop-down just fine (and it should be easy to iterate over them). However, I do not get the 'GO' button pressed. I tried it a bunch of different ways, a few I showed as a comment in the code.</p>
  <p>I am able to press the REPORTS tab, but I think that breaks down when there are different amounts of tabs, the line in the comments might work better, but for now I am not able to download all PDFs anyway, it just takes the first PDF of the page.</p>
  <p>Many thanks to whoever can help:)</p>