jeudi 7 juillet 2016

How to extract the exact url when the only url I have is general and randomized?

I'm pretty new to python programming and working with urls in general so any help would be greatly appreciated. I'm working with a website where there's thousands of webcams and each webcam takes a picture every half hour. What I'm trying to do is take several random images from each webcam from random points in time and use them for research. However, the only way to get a randomized image from this site is using a url that brings you to a different random image from any point in time from when that single webcam began taking pictures. I have code creating a giant list of these urls where there's about 3 random urls for each number image, but I need a way to get the exact url this url refers to.

For example, if I entered: http://ift.tt/29tpYrU

It comes up with this url: http://ift.tt/29kN54o

However, the first random url could also give me an image from the same webcam but from a different point in time so the url is slightly different.

Both of these urls are found by the randomized url but I need a way to save the exact urls generated from the random url in a CSV file so I can refer to them later. Right now all I'm doing is taking the number of a webcam like 1 but not knowing exactly what image it is referring to. Does anyone know of a way I can achieve this?




Aucun commentaire:

Enregistrer un commentaire