There is no static <table> tag in the html of this page. It is a React based page, and tables are created dynamically with javascript.
Edit: Adding a script to fetch data
To scrape this page, I see two options:
- As suggested by Håken Lid, you can use a headless browser simulator able to execute javascript like ghost.py, phantomjs, HtmlUnit, Selenium, etc
- Or you can skim through the html/javascript source code, watch browser requests and find the data source.
I prefer the second one; this script prints the content of the page, including data in tables:
# Python 3
import requests, re, json
def discard_format(dico):
if "_" in dico:
return dico["_"]
elif "$$" in dico:
return dico["$$"]
elif "$" in dico:
return ""
return dico
url_page = "http://www.sciencedirect.com/science/article/pii/S0378874116301696"
req = requests.get(url_page)
html = req.content.decode("utf-8")
token = re.search('"entitledToken":"(.*?)"', html).group(1)
url_data = "http://www.sciencedirect.com/sdfe/arp/pii/S0378874116301696/body?entitledToken=%s" % token
data = requests.get(url_data, cookies=req.cookies).content.decode("utf-8")
#print(data)
jsondata = json.loads(data, object_hook=discard_format)
print(jsondata)
html?