|
-
Oct 21st, 2011, 06:21 PM
#1
Thread Starter
Hyperactive Member
HttpRequest in VB.NET ?
Hi people.
I'm quite new to VB.NET as I had problems leaving vb6 because of all my daily-use projects were coded and maintained with it.
I didn't quite know where to start so I'll explain myself the best that I can.
In a new **vb6** project I am currently developping, I use HttpRequests to navigate some pages of a website. Using the webbrowser was not an option, this time, as it would have needed me to simulate mouse clicks and use sendkeys to input data. This part works great.
The problem is that I'm now at a screen where some server-side javascript code is supplied and I can't grab it in any way using httprequests. So, at that precise point, I'd like to be sent back intro a standard webbrowser on my form.
I've been told this wasn't going to be possible in vb6, ... but I could do it in .NET. Could someone confirm?
When the HttpRequest part is done, I end up with session-cookies saved in a string variable and the requestresponse gives me the whole .html of the last result. (anyway you httprequesters already know about it)
Any thoughts greatly appreciated.
-
Oct 22nd, 2011, 09:10 AM
#2
Re: HttpRequest in VB.NET ?
if you use a webbrowser, you can programmatically click htmlElements + fill html input fields.
post the url + more information + i'll write an example
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Oct 22nd, 2011, 10:38 AM
#3
Thread Starter
Hyperactive Member
Re: HttpRequest in VB.NET ?
Hi Paul. Like I said in my first post, the webbrowser approach was not an option because the fields CAN'T be populated by code. For this one, I had to go 'httprequest'.
Here's the url:
HTML Code:
http://www.ticketmaster.com/event/110046C8EA589AA5?artistid=776005&majorcatid=10001&minorcatid=60
The goal is to select "2" in the first drop down box (2 tickets). I got this achieved by requests but I need to have the webpage back before my eyes so I can enter the captcha challenge and manually continue with further steps. That's why I was wondering if I could somehow take my httprequest session infos (cookies/html?) and continue browsing through webbrowser on my form, without breaking the chain.
Thank you!
-
Oct 22nd, 2011, 09:49 PM
#4
Re: HttpRequest in VB.NET ?
A web browser is a UI control. If it is not being used as such then you should not be using it.
The first step for you would to be reading the Httpwebrequest class http://msdn.microsoft.com/en-us/libr...ebrequest.aspx
-
Oct 22nd, 2011, 11:11 PM
#5
Thread Starter
Hyperactive Member
Re: HttpRequest in VB.NET ?
Thanks for the link.
I wouldn't say I'm an expert of either, but I've used the webbrowser *A LOT* and have made a few projects using httprequests as well.
In my current project, I've witnessed advantages and disadvantages of both (web vs request) and have found what my next goal was.
So I would like to know if anyone has even done this.... Starting a routine on a site with cookies via httprequest, and continue its way onto a browser without breaking the chain.
That's what I'm at.
I can't do the entire way through webbrowser, and I can't do the entire way through httprequests.
Thank you.
-
Oct 23rd, 2011, 05:04 AM
#6
Re: HttpRequest in VB.NET ?
So the captcha is the issue. You could pass the cookie containers cookies and set the webbrowser cookie, but i would still be suspicious of it breaking the chain.
-
Oct 23rd, 2011, 10:23 AM
#7
Thread Starter
Hyperactive Member
Re: HttpRequest in VB.NET ?
Would anyone know how to do that? I coudln't figure it out.
-
Oct 23rd, 2011, 02:09 PM
#8
Lively Member
Re: HttpRequest in VB.NET ?
There's an option in that one, I haven't done it though but as part of my "Imagination", you can create a webbrowser not the Control but on the coding part like
Dim wb1 as new webbrowser
with that you don't have to pullout the objects, then do what paul said earlier, on HttpWebRequest i have no idea how, but good choice of question, most on my projects like "Account Creator" something like a bot, I'm doin it with webbrowser,
-
Oct 23rd, 2011, 02:10 PM
#9
Lively Member
Re: HttpRequest in VB.NET ?
and addition, if you are going to use httpwebrequest, you'll have to do alot of httpliveheaders catching ,
thats my problem before, and still haven't solved it, like a comment poster on wordpress w/c is hard @_@ darn.
-
Oct 23rd, 2011, 02:15 PM
#10
Thread Starter
Hyperactive Member
Re: HttpRequest in VB.NET ?
Thanks for your input! I've used arrays of browsers before, declared like you suggested. I just didn't thought it would help me inject the cookies to it? Maybe someone knows about that in the forums.
I'll test it out by myself, without having too much faith.
I, too, am used to do my tasks entirely in webbrowsers. I had to switch to httprequests because there's not way (that I know of) to fill that "How many tickets" dropdown on the webpage (see link in post #3 of this thread).
Still hoping some httprequest masterminds lands on this thread.
Thanks again. Any new inputs very welcome!
-
Oct 23rd, 2011, 02:17 PM
#11
Thread Starter
Hyperactive Member
Re: HttpRequest in VB.NET ?
And, yes, I was anticipating that I might modify the html and parse it a bit. As many links will be 'relative' (only start with "/"). I'll work on that when I know how to dump the html and cookies in a webbrowser on my form.
-
Oct 23rd, 2011, 02:20 PM
#12
Lively Member
Re: HttpRequest in VB.NET ?
anyways i'll try to make a codes for that , my projects aren't done yet, and its like a "Mass Creator" , i need that though, and btw, i'll add you on msn . wait ^_^
-
Oct 23rd, 2011, 02:27 PM
#13
Thread Starter
Hyperactive Member
Re: HttpRequest in VB.NET ?
I didn't get that "Mass Creator" part, but anyway, add me to msn and we'll talk!
-
Oct 23rd, 2011, 02:30 PM
#14
Lively Member
Re: HttpRequest in VB.NET ?
i am making a bot which scrapes at the same time creating accounts,i wanted it to apply threads. though i have it done partly, and btw , i already added you on msn
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|