1

Even though I am new to scrapy framework, I am able to write good spiders using scrapy. Recently I came across this page, where by entering address, and on submit I have to capture the latitude and longitude. Could any one help?

This code works for normal post requests:

return [FormRequest.from_response(response,
                    formdata={'username': 'john', 'password': 'secret'},
                    callback=self.after_login)]

But what about the ajax based form requests, like the above.

Santosh Kumar
  • 26,475
  • 20
  • 67
  • 118
Usha G
  • 29
  • 1

1 Answers1

0

This site uses Google Maps Geocode to fetch the data, so it's more easy to just use Google's API's.

It was requesting:

Request URL:http://maps.googleapis.com/maps/api/js/GeocodeService.Search?4s12%20Street%2C%20New%20York%2C%20NY&7sUS&9sen-US&callback=_xdc_._8xnwgc&token=93301

You might as well just sign up for the Google Maps API and query them yourself :)

Sjaak Trekhaak
  • 4,906
  • 30
  • 39