http - Keeping website open with Python Requests? -
i trying figure out how can keep connection website open. tried using while loop, after url, can see not connected website anymore. how can navigate url, , keep url open entire time while running loop? want loop forever, maybe print data website. here code tried , help! import requests import time url = 'https://www.google.com' s = requests.session() headers = {'user-agent': 'mozilla/5.0 (windows nt 6.1) applewebkit/537.36 (khtml, gecko) chrome/41.0.2228.0 safari/537.36'} r = s.get(url, headers=headers) while true: print str(r) time.sleep(10) what purpose of question? trying achieve holding open connection? i doubt can keep open forever, doing should work, extent. using requests session should ensure http keepalive option set appropriately, , remote server should keep tcp connection open after servicing each http request. if stop sending requests, server timeout connection , close it. the important point must keep making reques...