|
-
Aug 19th, 2006, 05:46 PM
#1
Thread Starter
PowerPoster
Filling in forms in webbrowser
Any chance that someone could give me the 101 on "navigating" webbrowser form objects?
Let me explain what I intend to do...I want to upload a file using http://mihd.net/ (and other similar sites like www.yousendit.com and such) but mihd.net uses an iframe in the main page, and I don't know how to navigate to that...also, I don't know how to do the same thing with www.yousendit.com (which is just a simple page with a load of boxes to be filled in...no iframes)
Possible ways I see of doing what I need to do:
1) Document.write putting the modified form back into the page and then somehow clicking the upload button...however I don't know how to set the focus to the iframe, as webbrowser.document.body.innerhtml will get the main page and not the iframe's HTML
2) Using elements (as in getelementbyid)...but I am HOPELESS at this and need help with understanding it :-)
3) Using cURL to handle the transmission...this is a long-winded way to do it, and I would rather not have to resort to having extra EXEs being included with the program I am writing (although it possibly will already have extra EXEs, I want as few as possible :-))...also, I would have to do a lot of messing about to find out what data to send using cURL for it to successfully upload the file
Help would be appreciated :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Aug 20th, 2006, 06:34 AM
#2
Fanatic Member
Re: Filling in forms in webbrowser
I've been trying to use a webbrowser to upload files for a while, but it's really difficult.
Microsoft has made it so that you can't simply 'fill-in' the path of a file in a form, because that would be a security risk (you could sneakily download files from a person's computer).
The only way that I've found to fill in the path of a file is to set focus to the field (using something like Web.Document.All("txt").focus) and then use SendKeys.
-
Aug 20th, 2006, 06:37 AM
#3
Hyperactive Member
Re: Filling in forms in webbrowser
On the same thought that shirazamod said... If the field doest move you could right a autoing script aka a piece of code that moves and clicks your mouse and then uses sendkeys to enter the data into the field...
Visual Basic Rules!!!!! 
-
Aug 20th, 2006, 06:44 AM
#4
Thread Starter
PowerPoster
Re: Filling in forms in webbrowser
 Originally Posted by shirazamod
The only way that I've found to fill in the path of a file is to set focus to the field (using something like Web.Document.All("txt").focus) and then use SendKeys.
That could work, although there's more than one textbox on the forum...I'll have a play about sometime soon. I think I might go with #1 if I can, in theory that should be the simplest way to do it as long as I work out how to access the iframe...would your way also get the textboxes in an iframe?
And VBMan, that's okay if you're not using your PC, but if you want it to run while you're doing other stuff it kinda interferes with what you're doing :-)
I have mouse move and mouse click code but I don't think it's of any use for this program I am making now
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Aug 20th, 2006, 07:01 AM
#5
Fanatic Member
Re: Filling in forms in webbrowser
The code I posted won't work for the iFrame.
What you can do is connect to mihd.net and then parse out the URL of the iFrame and then navigate to that URL and then use Web.Document.All("upfile_0").focus to set focus onto the field and then use SendKeys
-
Aug 20th, 2006, 07:05 AM
#6
Thread Starter
PowerPoster
Re: Filling in forms in webbrowser
 Originally Posted by shirazamod
The code I posted won't work for the iFrame.
What you can do is connect to mihd.net and then parse out the URL of the iFrame and then navigate to that URL and then use Web.Document.All("upfile_0").focus to set focus onto the field and then use SendKeys
In theory that would work, but I suspect that they have some sort of check in place to stop that from working...something like a referer check or such...I'll have a play around, like I said :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Aug 20th, 2006, 07:25 AM
#7
Fanatic Member
Re: Filling in forms in webbrowser
I've checked it and the only theck that they have is the auth code, and you will get that from the URL in the mihd.net page.
-
Aug 20th, 2006, 07:39 AM
#8
Lively Member
Re: Filling in forms in webbrowser
I have found the browser document functions to be very unpredictable, especially when multiple frames are involved in HTML. All frames are not updated every time that document completes, so need to look at frame count and number before parsing for your particular form. Have found that DOM collections do not work across multiple frames, in fact, I am more surprised when they work at all.
I use Firefox DOM Inspector to find out exactly where my desired elements are.
-
Aug 20th, 2006, 08:27 AM
#9
Thread Starter
PowerPoster
Re: Filling in forms in webbrowser
 Originally Posted by shirazamod
I've checked it and the only theck that they have is the auth code, and you will get that from the URL in the mihd.net page.
So you've never had the "Unathorised use, refresh page" message then? I might have to load the main page using inet rather than webbrowser, then the next page via inet...after that I am not sure :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Aug 20th, 2006, 08:43 AM
#10
Lively Member
Re: Filling in forms in webbrowser
I forget the syntax, but have always been able to get there. Once you know what frame your form is in, I use 'If frame.count>x' type statement in document complete function to be sure my form is included before I start parsing for it.
-
Aug 20th, 2006, 08:53 AM
#11
Thread Starter
PowerPoster
Re: Filling in forms in webbrowser
I looked into that on VBForums (searched for "frame.count" and found 3 results...all pertaining to VB frames and none about iframes or frames within a webbrowser...are you *sure* it's right? :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Aug 20th, 2006, 09:38 AM
#12
Fanatic Member
Re: Filling in forms in webbrowser
I don't think you can access iFrames through VB. You will need to get the auth code with the url, which will only last about twice.
You can connect to the main page by Inet to get the URL and then connect the webbrowser to the url with the auth code in it, eg:http://5.mihd.net/?module=upload&auth=9c87367b7c48a3e03d56356843681f73
-
Aug 20th, 2006, 10:14 AM
#13
Thread Starter
PowerPoster
Re: Filling in forms in webbrowser
 Originally Posted by shirazamod
You can connect to the main page by Inet to get the URL and then connect the webbrowser to the url with the auth code in it
Yeah, I was thinking about that too...I am wondering if the owners of the site will notice that the different parts of the site are accessed with different browser versions or something (I assume inet is different to the webbrowser to the server you're accessing with it :-))
I've put this little project on hold for a bit (will probably have a go tonight) while I work on something else...this is how I work, I have literally hundreds of half-finished projects but each one I work on has added to my programming knowledge a little so I don't mind too much :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Aug 20th, 2006, 10:59 AM
#14
Fanatic Member
Re: Filling in forms in webbrowser
lol, yea I also work on a bunch of projects at the same time.
You can change what browser 'appears' to be accessing the website so that the owners won't have a clue.
You can only do this if you use Inet.Execute rather than Inet.OpenURL.
If you are using Inet.Execute, then you can use this to change the User-Agent:
VB Code:
Inet.Execute "http://mihd.net", "GET", , "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
-
Aug 23rd, 2006, 03:22 AM
#15
New Member
Re: Filling in forms in webbrowser
interesting project
wondering once you upload, how you expect to get the download link?
-
Aug 23rd, 2006, 04:46 AM
#16
Thread Starter
PowerPoster
Re: Filling in forms in webbrowser
 Originally Posted by x50x50
interesting project
wondering once you upload, how you expect to get the download link?
Same way I fill in the data in the form...my most recent way with mihd was to sendkeys {tab} to the right box and {home} then {shift-end} and {ctrl-c} to get the data into the clipboard then {ctrl-v} into a textbox...if it's not in an iframe I would just get the HTML source of the webbrowser :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Aug 23rd, 2006, 04:55 AM
#17
New Member
-
Aug 23rd, 2006, 05:05 AM
#18
Thread Starter
PowerPoster
Re: Filling in forms in webbrowser
 Originally Posted by x50x50
cool, did u manage to get this app working, i dont know much vb [c, c#,php is my speciality  ]
rapidshare is blocked in my country  so im going thru dozens of uploaders
atm, this site looks promising, the upload meter seems nice and so far i didnt get any "u have downloaded xx so feck off and buy our crappy premium account" type of message, got the unathorised use one tho, but refreshing page gets rid of that 
First look at http://www.jdempsey.com/2005/12/08/f...toragesending/ ...it's where I got mihd from :-)
I tried using yousendit.com, but their submit button isn't clickable because you can't tab to it...which is a pain.
I have an alternative way that will work on all sites, and that's using cURL...just it'll be a lot more messing about with cookies and such to get the upload working. I probably will go with cURL in the end, if I have problems with navigating any more sites I try to use...I need as many different hosts as possible for what I am working on :-)
And I had the program UPLOADING the link with mihd but not getting the link...the problem was with getting the sendkeys to tab to the right box each time (focus changes each time) but I do have a few ways of getting around that (involves modifying the HTML in the document and removing ads and text so it's just the iframe)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Aug 23rd, 2006, 05:15 AM
#19
New Member
Re: Filling in forms in webbrowser
cheers for that, i took more detailed look at mihd ,
i see what you mean about the iframe,
seems they the only upload site that have something like that (that ive seen so far),
the upload meter is using perl
also for some reasons downloads are on port 81 (and the downloads work with download managers yepee! )
maybe just contact them and ask for premium account or uploader status, most of these sites are happy when people upload to them (some like oxyshare even promise payment per 1000downloads or have ftp uploads) so they might give account for free if they know u will drive loads of traffic to them
anyways my 2cents
-
Aug 23rd, 2006, 05:16 AM
#20
Fanatic Member
Re: Filling in forms in webbrowser
You mean using cURL in PHP?
-
Aug 23rd, 2006, 05:27 AM
#21
Thread Starter
PowerPoster
Re: Filling in forms in webbrowser
 Originally Posted by shirazamod
You mean using cURL in PHP?
http://cURL.haxx.se is a program that I have used for advanced HTTP transfers. It basically does what winsock does, but without having to learn how to use winsock properly :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Aug 23rd, 2006, 05:58 AM
#22
Fanatic Member
Re: Filling in forms in webbrowser
-
Aug 23rd, 2006, 06:00 AM
#23
New Member
Re: Filling in forms in webbrowser
hmm im curious about this auth string being passed to the iframe, any of yee figure it out ?
-
Sep 3rd, 2006, 03:48 PM
#24
New Member
Re: Filling in forms in webbrowser
looks like mihd switched to flash uploads...
-
Sep 3rd, 2006, 03:51 PM
#25
Thread Starter
PowerPoster
Re: Filling in forms in webbrowser
Flash makes it harder to do it through the webbrowser (no way to set focus to the button using sendkeys) but I bet there's an easy way to do it using inet, just emulating the page's functions as it sends the file :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Sep 3rd, 2006, 03:57 PM
#26
New Member
Re: Filling in forms in webbrowser
oh well, plenty of other services
looks like oxyshare si quite hackable
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
|