title: How to click the CSV button in a website and download the data in python
body: <p>I am trying to download the CSV and JSON data from following website: <a href="https://worldpopulationreview.com/countries/countries-by-gdp/#worldCountries" rel="nofollow noreferrer">https://worldpopulationreview.com/countries/countries-by-gdp/#worldCountries</a></p>
  
  <h1>How to simulate clicking csv file?</h1>
  
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  import requests
  from lxml import html,etree
  
  url = "https://worldpopulationreview.com/countries/countries-by-gdp/#worldCountries"
  
  # now I am not sure, how to click csv button of actual website
  # also I am not sure how it will download the csv file
  # to DOWNLOADS as like when I click the page
  
  </code></pre>
  
  <h1>I can scrape webpage, but I want to learn clicking of button</h1>
  
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  import requests
  
  url = "https://worldpopulationreview.com/countries/countries-by-gdp/#worldCountries"
  
  r = requests.get(url)
  df = pd.read_html(r.text)[0]
  df.to_csv('data.csv')
  </code></pre>