Jump to content

How does one simply...."grab" that image?


MySQL_Narb

Recommended Posts

Hi, I've been working on this problem for the past hour. I can't seem to figure out how to save a CAPTCHA image. As we all know, a CAPTCHA image is only generated once. So this complicates things for me.

 

http://api.solvemedia.com/papi/challenge.noscript?k=YofwLNxxBvEMSuDl.BVlHV-zV-MV8L61

 

As you can see in the above URL, any attempt to visit the direct image link will still result in a new image.

 

Is there any possible way to get the image as is when you first load the webpage? I'm starting to think this is near impossible in PHP.

Link to comment
https://forums.phpfreaks.com/topic/280048-how-does-one-simplygrab-that-image/
Share on other sites

As you can see in the above URL, any attempt to visit the direct image link will still result in a new image.

If you keep refreshing the page, well yeah. So only visit the page once.

 

Is there any possible way to get the image as is when you first load the webpage? I'm starting to think this is near impossible in PHP.

The browser is the one that retrieves the image. Intentionally. If you're using PHP then it won't retrieve the image unless you write code telling it to. Intentionally.

If you keep refreshing the page, well yeah. So only visit the page once.

 

The browser is the one that retrieves the image. Intentionally. If you're using PHP then it won't retrieve the image unless you write code telling it to. Intentionally.

 

Well, is it possible to download a CAPTCHA image without "requesting" it again (maybe from a page that is already loaded)? Say you use cURL to load the page and grab the url of the image; you then tell cURL to download that image in the URL. It downloads the CAPTCHA image; however, when you go to download the image, is that not another request resulting in a changed CAPTCHA picture?

is that not another request resulting in a changed CAPTCHA picture?

No, because there was never a request to the captcha when you downloaded the page. You'd just be emulating how a browser works:

1) Download the HTML source of the page

2) Parse the source to acquire the captcha URL

3) Download the image from the captcha URL.

 

That is what the browser does, then it displays the image it gets on the page where necessary. You'd have your script do the same thing, but rather than display the image save it to a file.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.