https://stackoverflow.com/questions/36513597/how-do-you-request-on-imdb-api-in-python
movies = {}
import json, requests
baseurl = "http://omdbapi.com/?t=" #only submitting the title parameter
with open("movies.txt", "r") as fin:
for line in fin:
movieTitle = line.rstrip("\n") # get rid of newline characters
response = requests.get(url + movieTitle)
if response.status_code == 200:
movies[movieTitle] = json.loads(response.text)
else:
raise ValueError("Bad request!")
print movies['scream']
import json, requests
url = "http://www.omdbapi.com/?t=scream"
response = requests.get(url)
python_dictionary_values = json.loads(response.text)
python rotten tomatoes:
https://www.blog.pythonlibrary.org/2013/11/06/python-101-how-to-grab-data-from-rottentomatoes/
https://pypi.python.org/pypi/rtsimple
No comments:
Post a Comment