title: Can't load contents of an iframe with Python
body: <p>I need scrape the contents of an iframe using python.</p>
  
  <p>As the web-page loads it submits a request and gets the content of the iframe in the response. When I use BeautifulSoup to get the data it just gives the initial blank iframe contents. </p>
  
  <p>Is there any way I can get the contents? If so, how do I do it in my case?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  
  page = requests.get("https://etherscan.io/token/0x168296bb09e24a88805cb9c33356536b980d3fc5#balances" + "/token/generic-tokenholders2?a=0x168296bb09e24a88805cb9c33356536b980d3fc5&amp;amp;s=100000000000000000", headers={"content-type":"type"}, timeout=5)
  soup = BeautifulSoup(page.content, "html.parser")
  
  balances = soup.find(id="balances")
  print(balances.prettify()) 
  table_items = balances.find_all('tr') #I'm trying to collect all the &lt;tr&gt; tags inside an &lt;iframe&gt;
  print(table_items) #It shows an empty list because the &lt;iframe&gt; didn't load
  </code></pre>