title: How do I use Python to trigger the download of a file from a website?
body: <p>I'm trying to set up a script to pull data from a website on a daily basis and I'm having trouble getting Python to actually read the table - I'm not a professional coder. I've tried two methods:</p>
  
  <p>1) Scrape the table (headers, rows, etc) using Beautiful Soup, and </p>
  
  <p>2) Use the website's export with excel button</p>
  
  <p>Here is the precise website:
  <a href="https://scgenvoy.sempra.com/index.html#nav=/Public/ViewExternalLowOFO.getLowOFO%3Frand%3D200" rel="nofollow noreferrer">https://scgenvoy.sempra.com/index.html#nav=/Public/ViewExternalLowOFO.getLowOFO%3Frand%3D200</a></p>
  
  <p>So far my code is: </p>
  
  <pre class="lang-py prettyprint-override"><code>#Imports
  import requests
  import urllib.request
  import pandas as pd
  from lxml import html
  import lxml.html as lh
  from bs4 import BeautifulSoup
  `URL ='https://scgenvoy.sempra.com/index.html#nav=/Public/ViewExternalLowOFO.getLowOFO%3Frand%3D200'`
  
  #Create a handle, page, to handle the contents of the website
  requests.packages.urllib3.disable_warnings()
  page = requests.get(URL, verify=False)
  </code></pre>
  
  <p>I think the easiest method would be to trigger the "export" function with the </p>
  
  <pre><code>xpath //*[@id="content"]/form/div[2]/div/table/tbody/tr/td[4]/table/tbody/tr/td[1]/a
  </code></pre>
  
  <p>All help is greatly appreciated!</p>