1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Saving hotmail cpatcha images?

Discussion in 'General Programming Chat' started by xpro, Feb 27, 2010.

  1. xpro

    xpro Regular Member

    Joined:
    Jan 21, 2009
    Messages:
    416
    Likes Received:
    16
    Hello

    Hotmail's captchas work differently, with most sites I take the url of the captcha and save it. But with Hotmail if I access the captcha's url for the second time a different image loads. How can I save the same picture so I can send it to decaptcher?

    Best Regards!
     
  2. smack

    smack Junior Member

    Joined:
    Feb 1, 2010
    Messages:
    182
    Likes Received:
    78
    Occupation:
    Software Engineer/Evil Genius
    Location:
    inside .NET
    what language are you using?

    my typical approach to that is to request the page, parse out the image link, then request the image and pull the image data from the return packet. then that is what you send in the decap post packet.

    - edit -

    that's the way most captcha systems work.
     
    Last edited: Feb 27, 2010
  3. phpmentor

    phpmentor Newbie

    Joined:
    Feb 27, 2010
    Messages:
    17
    Likes Received:
    2
    with perl I do the following to save image captchas using WWW::Mechanize

    Code:
    
    my $img_obj = $mech2->find_image( url_regex => qr{image\?c=} );
    
    $image_data = $mech3->get( $img_obj->url,
                   ':content_file' => 'captcha.jpg' );
    
    
    this will save the image as captcha.jpg
     
  4. phpmentor

    phpmentor Newbie

    Joined:
    Feb 27, 2010
    Messages:
    17
    Likes Received:
    2
    with perl I do the following to save image captchas using WWW::Mechanize

    Code:
    
    $mech2 = $mech->clone();
    my $img_obj = $mech->find_image( url_regex => qr{ts_image\.php} );
    
    $image_data = $mech2->get( $img_obj->url,
                   ':content_file' => 'captcha.jpg' );
    
    
    
    this will save the image as captcha.jpg

    PS: the cloning of the object is very important so that the session does not change