0

我想获取 url 的数据并将其存储在文件中。我用了这个命令

wget -O output_file.txt "http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true"   

它运行良好,数据存储在 output_file.txt 中。现在,当我使用另一个这样的网址时:

wget -O output_file.txt "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=YOUR_API_KEY"  

,它显示一个错误

Resolving maps.googleapis.com (maps.googleapis.com)... 74.125.135.95, 2404:6800:4001:c01::5f 
Connecting to maps.googleapis.com (maps.googleapis.com)|74.125.135.95|:443... failed:
Connection refused. Connecting to maps.googleapis.com (maps.googleapis.com)|2404:6800:4001:c01::5f|:443... failed: Network is unreachable. 

此外,数据也没有存储在上述文件中。我也尝试使用其他 url,它工作正常,除了上面提到的 google places api url。我想提一下,如果我只是在某个浏览器中输入有问题的 url,它就可以正常工作。但是那样,我只能查看数据。但我希望将这些数据存储在某个文件中。

所有问题都在 linux (ubuntu 12.04)

4

0 回答 0