grab the data from api
def grab_data(url): r = requests.get(url) return r.text def main(): url = 'http://www.example.com/' data = grab_data(url) print(data) if __name__ == '__main__': main() A: You can use the requests module to get the data from the website. The requests module is a wrapper around urllib2