我正在尝试将以下 URL 读入 Python:
http://www.google.com/trends/fetchComponent?q=nepal&cid=TIMESERIES_GRAPH_0&export=3
使用代码:
trend_url = 'http://www.google.com/trends/fetchComponent?q=nepal&cid=TIMESERIES_GRAPH_0&export=3'
response = urllib2.urlopen(trend_url)
the_page = response.read()
由于我不明白的原因,the_page 的结果值是一个错误页面。
更新:我认为这个问题与一些身份验证问题有关:当我尝试在浏览器的隐身窗口中打开链接时,它也会返回一个错误页面。