I'm trying to scrape this table (https://futures.tradingcharts.com/marketquotes/ZC.html) with python. I've tried something based on this post, but when I manually inspect the source of the website, I don't see the table. How do I scrape this table?
<div class="mq_page_wrapper">
<script type="text/javascript">
$(document).ready(function(){
generateTCPSLink();
});
function generateTCPSLink(){
var root = location.protocol + '//' + location.host;
var url_param = {
action:'tcps_logged_in',
timestamp: (new Date()).getTime()
};
$.getJSON(root+'/widgets/footer_ajax/footer_common_functions.php?'+$.param(url_param),function(data){
if(data.logged_in){
$('span#tcps_link').html("Logout:<br> <a href='"+root+"/premium_subscriber/tcps_logout.php"+"'>Premium Subscriber</a><br>");
}else{
$('span#tcps_link').html("Login:<br> <a href='"+root+"/premium_subscriber/login_subscribe.php?premium_link"+"'>Premium Subscriber</a><br>");
}
});
}
</script>
<div id="members_classic">
<span id="tcps_link"></span>
</div>
from selenium import webdriver
import time
import os
from bs4 import BeautifulSoup
chrome_path = r"C:\Users\Desktop\chromedriver.exe"
driver = webdriver.Chrome(chrome_path)
driver.get('https://futures.tradingcharts.com/marketquotes/ZC.html')
time.sleep(80)
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(5)
html = driver.page_source
soup = BeautifulSoup(html,'html.parser')
print soup