I am using pypi's google-streetview 1.2.4 library in python for this. the code is below. <https://pypi.org/project/google-streetview/ https://rrwen.github.io/google_streetview/#> I am trying to scrape multiple locations. I have a csv file with lat. lon.
# Import google_streetview for the api and helper module
import google_streetview.api
import google_streetview.helpers
# Create a dictionary with multiple parameters separated by ;
apiargs = {
'location': '25.626835,-80.408357;25.635625,-80.390195',
'size': '640x640',
'heading': '0;90;180;270',
'pitch': '0',
'key': 'google_dev_key'
}
# Get a list of all possible queries from multiple parameters
api_list = google_streetview.helpers.api_list(apiargs)
# Create a results object for all possible queries
results = google_streetview.api.results(api_list)
# Preview results
results.preview()
# Download images to directory 'downloads'
results.download_links('/content/drive/MyDrive/Images')
I think I should use for loop to alternate coordinates however I am not sure how to integrate into code above. Could you help me how to do this? Thank you.
cord= [46.414382,40.720032]
ate = [10.013988,-73.988354]
def coordinate():
for i, x in enumerate(cord):
y= ate[i]
print(x,y)
coordinate()