1

I'm familiar with using urllib.urlretrieve to grab an image from online (such as explained here: https://stackoverflow.com/a/3042786/).

I want to grab a set of images with url's ending in /get.aspx?1234 (with varying numbered suffixes). I don't know exactly how aspx works, but I know that when I tried using urllib.urlretrieve to grab the images it didn't work. What other function can I use?

When I put the url ending in /get.aspx?1234 in my browser I just get an image that shows up where I can right click and save as a jpeg. When I click open image in new tab, I get the exact same url ending in /get.aspx?1234. I don't know what better url to use to identify this image.

Community
  • 1
  • 1
Oats
  • 13
  • 3

1 Answers1

0

Check headers you sent when you open the image in the browser. Server can check them somehow to prevent automatic downloads. So, basically, you need to keep same headers when you request the URL programatically.

Aleksandr Shumilov
  • 1,975
  • 2
  • 19
  • 29