Jump to content

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


Go to solution Solved by requinix,

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

  • Solution

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.