Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27355

Filling out a web form and submit it

$
0
0
I am using the live http header plugin to get the data to be filled and the site to be browsed,
my problem is the program is able to browse the web form but it only stops there it won't fill up the form and submit it, i think there is something wrong with my encoding part.
I am really confused right now and need help. Thanks in advance.

here is my current code:

Code:

        Dim postData As String = "authenticity_token=QV4Ry01aXYCfW7IhzPs1mN%2B3VJ%2FlCLr0tr0XtytoSIs%3D&email%5Bto_address%5D=intes2010%40gmail.com&email%5Bfrom_name%5D=Marc&email%5Bfrom_address%5D=test%40email.com&email%5Bnote%5D=test&email%5Bcopy_yourself%5D=0&id=house-of-pies-466226000"
        Dim tempCookies As New CookieContainer
        Dim encoding As New UTF8Encoding
        Dim byteData As Byte() = encoding.GetBytes(postData)

        Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create("http://www.yellowpages.com/los-angeles-ca/mip/house-of-pies-466226000/send_email?lid=1000083727260"), HttpWebRequest)
        postReq.Method = "POST"
        postReq.KeepAlive = True
        postReq.CookieContainer = tempCookies
        postReq.ContentType = "application/x-form-urlencoded"
        postReq.Referer = "http://www.yellowpages.com/los-angeles-ca/mip/house-of-pies-466226000/send_email?lid=1000083727260"
        postReq.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"
        postReq.ContentLength = byteData.Length

        Dim postreqstream As Stream = postReq.GetRequestStream()
        postreqstream.Write(byteData, 0, byteData.Length)
        postreqstream.Close()

the http header i was basing on:

Name:  EMifY1v.jpg
Views: 4
Size:  75.0 KB

here is the web form i want to auto fill up and submit.

http://www.yellowpages.com/los-angel...=1000083727260
Attached Images
 

Viewing all articles
Browse latest Browse all 27355

Trending Articles