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

PHPLd Submitter using HTTPWebrequest

Discussion in 'Visual Basic .NET' started by SEOboss, Jan 15, 2012.

  1. SEOboss

    SEOboss Junior Member

    Joined:
    Nov 23, 2009
    Messages:
    166
    Likes Received:
    38
    Occupation:
    IM
    Location:
    India
    I am automating form of following web sites using HTTPWebRequest in vb.net

    Code:
    http://www.ignite400.org/submit.php,
    http://www.tradingyp.com/submit.php
    These sites are having dynamic captcha & these captcha get changed for every http web request.

    what I want is submit request happens, the captcha image should pop in a small window and I wanted to enter the captcha and click ok, then it should submit to the site.

    showing captcha image on box is not ptoblme but the problme is captcha gets changed on request & page gets refreshed

    any way to keep same captcha with out refersing using httpwebrequest
     
  2. hatemachine

    hatemachine Regular Member

    Joined:
    Jan 14, 2011
    Messages:
    271
    Likes Received:
    1,138
    The first site is very easy. It simply generates a hidden hash which can be used only once.

    parsehashvalue = "><input id="IMAGEHASH" name="IMAGEHASH" type="hidden" value="672143d5fc04dc6408cb984451491fae"

    downloadfile("http://www.ignite400.org/captcha.php?imagehash= + parsehashvalue"

    I'm not sure what your issue is with the second site because to receive the captcha you simply have to request http://www.tradingyp.com/captcha.php
     
  3. SEOboss

    SEOboss Junior Member

    Joined:
    Nov 23, 2009
    Messages:
    166
    Likes Received:
    38
    Occupation:
    IM
    Location:
    India
    Hi

    I tried u r solution solution it gives some error "Could not fetch image phrase!"

    PHP:
    http://www.ignite400.org/captcha.php?imagehash=eda1911bf3039bb703852049b1d1064b 
     
  4. hatemachine

    hatemachine Regular Member

    Joined:
    Jan 14, 2011
    Messages:
    271
    Likes Received:
    1,138

    As I have already stated, the hash value is only valid for _ONE_ request. You can't open it in your browser if you have already requested it in your application.
     
  5. shubhamm

    shubhamm Junior Member

    Joined:
    Jan 25, 2010
    Messages:
    107
    Likes Received:
    25
    Occupation:
    Developer
    Location:
    BHW
    1st send Webrequest to the page & grab the source then run Regex

    Code:
    <img src="[^"]+
    Replace the <img src=
    you will get Captcha Value which will be valid for One time and use it in Submitting the Data..
     
  6. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,879
    Likes Received:
    1,931
    Form1.vb:
    Code:
    CaptchaForm.PictureBox1.Image = New System.Drawing.Bitmap(New IO.MemoryStream(New System.Net.WebClient().DownloadData(CaptchaImageURL)))
                    CaptchaForm.ShowDialog()
                    CaptchaAnswer = CaptchaForm.TextBox1.Text
    CaptchaForm.vb:
    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Me.Close()
        End Sub