擅长:python、mysql、java
<p>您需要将查询参数附加到基本url,以便<code>urllib.urlopen</code>创建GET请求。你知道吗</p>
<pre><code>>>> url = "https://disc.gsfc.nasa.gov/SSW/#keywords="
>>> params = {'keyword':"(GPM_3IMERGHHE)", 't1':"2019-01-02", 't2':"2019-01-03", 'bboxBbox':"3.52,32.34,16.88,42.89"}
>>> quoted_params = urllib.urlencode(params)
>>> quoted_params
'bboxBbox=3.52%2C32.34%2C16.88%2C42.89&t2=2019-01-03&keyword=%28GPM_3IMERGHHE%29&t1=2019-01-02'
>>> full_url = url + quoted_params
>>> full_url
'https://disc.gsfc.nasa.gov/SSW/#keywords=bboxBbox=3.52%2C32.34%2C16.88%2C42.89&t2=2019-01-03&keyword=%28GPM_3IMERGHHE%29&t1=2019-01-02'
>>> resp = urllib.urlopen(full_url)
>>> html = resp.read()
</code></pre>