尝试增加方法的
timeout参数
requests.get:
requests.get(functionurl, headers=headers, timeout=5)
但是很可能服务器会阻止您的脚本以防止报废尝试。如果是这种情况,您可以尝试通过设置适当的标题来伪装Web浏览器。
{"User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 GTB7.1 (.NET CLR 3.5.30729)", "Referer": "http://example.com"}


