HTTP Error 504: Gateway Time-out when trying to read a reddit comments post
问题 I am encountering an error when trying to get a comments' http from reddit. This has happened to various URLs (not all of them with special characters) and this is one of them. In one hour time frame, there may be 1000 or more requests to the reddit.com domain. hdr = {"User-Agent": "My Agent"} try: req = urllib2.Request("http://www.reddit.com/r/gaming/" "comments/1bjuee/when_pokΓ©mon_was_good", headers=hdr) htmlSource = urllib2.urlopen(req).read() except Exception as inst: print inst Output>