I need to scrape the entire HTML from journal_url, which for the purpose of this example will be http://onlinelibrary.wiley.com/journal/10.1111/(ISSN)1467-6281/issues . I have followed the requests examples displayed on a few questions on this site, but I am not getting the correct HTML returned with either the .text or .json() methods for requests.get. My goal is to display the whole HTML including the ordered list underneath each year and volume pull-down.
import requests
import pandas as pd
import http.cookiejar
for i in range(0,len(df)):
journal_name = df.loc[i,"Journal Full Title"]
journal_url = df.loc[i,"URL"]+"/issues"
access_start = df.loc[i,"Content Start Date"]
access_end = df.loc[i,"Content End Date"]
#cj = http.cookiejar.CookieJar()
#opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
headers = {"X-Requested-With": "XMLHttpRequest",
"User-Agent": "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"}
r = requests.get(journal_url, headers=headers)
response = r.text
print(response)
"X-Requested-With"inheaders?