title: Finding downloadable content in webpage without knowing what the page looks like
body: <p>I want to find downloadable content in a webpage but I don't know what the webpage looks like. Right now, I am looking at all links</p>
  <pre class="lang-py prettyprint-override"><code>links = driver.find_elements(By.XPATH, &quot;//a[@href]&quot;)
  </code></pre>
  <p>and buttons</p>
  <pre class="lang-py prettyprint-override"><code>buttons = driver.find_elements(By.TAG_NAME, &quot;button&quot;)
  </code></pre>
  <p>For each link (which has an <code>href</code> attribute as seen in the XPATH specification), I check whether or not it points to a page with some form of machine readable file I am looking for (either <code>.csv</code> or <code>.json</code>);  if the link does not have one of these extensions as a suffix, I assume it does not reference a machine readable file.</p>
  <p>As for the buttons, I know of no way to check what they may contain other than naively clicking on them (<code>button.click()</code>). While this is clearly dangerous, especially because this function will be applied on thousands of websites, I don't know how else to do it.</p>
  <p>Is there any other way I could check for downloadable content? Additionally, are there any other page elements I should be looking for, besides links and buttons, and are there any more efficient methods of doing what I want?</p>
  <p>Any help is greatly appreciated. Thanks!</p>