我需要做一个循环并从页面获取json数据。页面URL的生成如下:
https: //*.*bounds=506,168,507,169
https: //*.*bounds=506,169,507,170
https: //*.*bounds=506,170,507,171
https: //*.*bounds=506,170,507,171
https: //*.*bounds=505,171,506,172
https: //*.*bounds=506,173,507,174
取决于坐标。
例如,
https: //*.*bounds=506,170,507,171
for Latitude: 50.6015314505
longitude: 17.0410603428
https://*.*bounds=508,163,509,164
for Latitude: 50.859299
longitude: 16.3206665
我认为这个循环必须包括这样的东西:
https: //*.*bounds= {lat}, {lon}, {lat + 1}, {lon + 1}?
限制:
如何在Python 3中执行此操作?
答案 0 :(得分:0)
解决方案:
for lat in range(490, 550):
for lon in range(140,243):
print("%d,%d,%d,%d" % (lat, lon, lat + 1, lon + 1))