jeudi 2 juillet 2015

How to generalise a GET request?

Context : I am trying to get the list of the addresses of the stores of the brand Alain Afflelou. Since the website appeals to Ajax, I didn't try to implement a scraper (but I know it is possible, I've heard about selenium), I used Live HTTP Headers instead to intercept the GET requests.

This way, I was able to retrieve two GET requests :

GET /action/project/StoreMarkers?latitude=48.854575763858286&longitude=2.352305499999943&distance=20000&services=WyI0ODI3NiIsIjQ4Mjc4Il0%3D HTTP/1.1

GET /action/project/StoreMarkers?storeid=45519&latitude=&longitude= HTTP/1.1

From there, I could reconstitute an url for the browser :

http://ift.tt/1CM7qYQ

http://ift.tt/1LF661l

Assuming that in the first one, distance is for distance from the middle of the bubble I clicked on the map http://ift.tt/1CM7qYU , it is easy to modify the url to get the whole list of stores like this :

http://ift.tt/1CM7tnB

But it would be more rigourous to use the second GET request and if allowed, alter it this way :

http://ift.tt/1CM7qYV

It doesn't work to put ALL or '' in the url, so I wondered if there was a conventional way to write this url so that every storeid would be requested (without a loop on every figure possible to 8 digits...).

Is it possible to do this ?




Aucun commentaire:

Enregistrer un commentaire