Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Hi kleinma,
i am able to login to a web page....now i wanted to test all the username along with its pwd which is default 123456
user name from database will be check for pwd 123456 how can i get to know which all users has changed its pwd
i am able to login with correct username and password
i used WebBrowser1_NewWindow event because if user name is correct the url gets changed but how can i get to know that a particular users has changed its pwd
When Pwd is entered wrong there is no change in the url or no window is changed only the page display a warning message saying Login Failed ! Invalid Username or Password
Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
If WebBrowser1.Url.AbsoluteUri = "http://192.168.10.4/cgi/index.php?dispSession=1" Then
MsgBox("Correct Pwd")
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
I'm using VB6 and using the webbrowser control to fill the form and submit to a commercial website that has weather. The problem is I can determine that the initial website has completely loaded by using the DocumentCompleted method. I then can fill the form with the city that I want and submit. The DocumentCompleted subroutine is not triggered again. THe only way I could figure out how to wait for the response from the server was to count the number of TitleChange events that occurred. THen I can parse the page for the info I need.
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Loading the website is simple and small code foot print. The webbrowser can be hidden so the user doesn't see anything. I'm thinking the ReadyState property holds the answer to my problem (though I see someone else is using the Title count also, wonder why)
Bypassing the webbrowser would require significant coding (cookies etc)
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Pls guys help mee i saw that u have a lot of work in this forum.
It iis so helpful. but i cant solved this problame.
I wanna fill a form and submit it ,i can fill it but the submit methode doesnt work
and i tired
.InvokeMember("submit")
System.Windows.Forms.SendKeys.Send("ENTER")
but doesnt work.
many thanks
Originally Posted by luke18
Hi! kleinma pls help me i try to make an autosubmit program for this website:www.facebook.com
for the reg form.but i try many way for clicking the submit(Sign Up) button but i cant do it...could u help me??
I try .InvokeMember("submit")
System.Windows.Forms.SendKeys.Send("ENTER")
but it doesnt work:S
I use vb 2008, pls help me:/
many thanks!!
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Hi ive used this thread to help me alot, when trying to get data from a web site for a internal system. ive now come across a problem which im a bit stuck on.
the site im working with isnt mine but a site we pay to use for data, on most of the pages i have mangaed to get the data or set or update fields but im having issues when trying to set the value on this box
Re: Manipulate/Change/Form Fill data in web pages using the Webbrowser control
Hi,
Please forgive my Ignorance here but I'm going to ask anyway!
I still don't see how this is going to log into a website that requires a username and password. I am trying to follow along with this thread but am still stuck.
I have made an App. to just store links User names and passwords to all the sites I go to (just like this one) and I thought it would be nice if I could login automatically. I would really appreciate some help.
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
I have worked with this quite a bit. Its tricky
Basically I use
vb Code:
PA="the URL"
WebBrowser1.navigate (PA)
Then in
vb Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If URL = FP & "/" Then 'notice that you may have to check if the end back slash is there, it isn't always. Also, this procedure is fired a couple of times and you need to check to see what page is being completed.
Do Until pDisp Is WebBrowser1.object
Loop
If Username.Text > "" And Password.Text > "" Then
With WebBrowser1.Document
.All("USERNAME").Value = Username.Text
.All("PASSWORD").Value = Password.Text
'.All("Submit").Click
'.All("ENTER").submit
'.Forms(0).submit 'Use this to submit the info if the
'one above it doesn't work.
.myform.submit
' myform is the name of the form on the webpage,
'if you use the ones above, they may not work
'and the third one seems to fire all the submits on the page.
'You'll have to see which one works for each site
End With
call subroutine 'to parse whatever you want.
End if
Interestingly, in the parsing arena, I have noticed that if I parse
WebBrowser1.Document.body.innerText or WebBrowser1.Document.body.innerHTML
on my desktop I get
Notice that the type attribute is switched. I have no idea why but it cost me alot of time to figure it out. I basically have to check and see which one is returned.
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Hello kleinma..
I've read a couple pages back and read that you were making a new example code for VS 2008. I wonder if you have finished it? Because I've checked the 2005 version and I think I could be really helped if it was on 2008
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Hi Kleinma,
if ur still following this thread... plz.. need ur help....
not sure if this is where I should post but this quite similar to what i need.
so here it is:
i have a web application (using vs2008), the user will enter his username and password and a message and click on the submit button.
once the submit button is clicked, i need to open up a url in-memory (something like behind the scenes) without using the webbrowser control. once the url is opened, fill in the username and password supplied in my page, and submit the page, get the response, open a link which is in the page, which will redirect to a new page say page2.aspx, there i have a textbox for entering the message, i input the message the user entered in my application and then click the submit button in the page2.aspx, after clicking the button the page is posted and a message is displayed in a label in the page2.aspx which i need to capture and display it in a label on my application. then close the request that i made.
please help me with some sample code or point me in the direction i need to go in.. or some existing threads.
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Easiest way is to use the code above I provided on Dec 17. Also note that my code doesn't always work but I commented out the other methods for submitting. Use the webbrowser control just don't show it or move it off screen.
You have to parse out the "link which is in the page" by using something like
InStr(1, WebBrowser1.Document.body.innerHTML, "courier") to find the position of the word "courier". Then its just a matter of widdling it down to get your URL. You can use a second webbrowser to launch the new link and so on.
Note: Allow time for the page to load, use a timer control (or if you are using a separate webbrowser for each new run, you can use the webbrowser.documentcomplete function.
1. i open a url, search a particular text in a textbox on it (basically a ticket #)
2. when the search result loads the tkt # disaplayed will contain a link to open the ticket , i need to send "click" to this (open the link)
3. after the ticket is opened i need to send some data to combo boxes & textboxes
i have already done steps 1 & 3 but stuck @ step # 2 since the elementid of the search result is always going to vary, i tried it with a fixed ticket # & worked fine, how do i achieve step # 2 ?
this will save lot of my time with some repetitive tasks, pls help !
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Thanks very much for the info on this thread. I have learned much since finding it. Below is a line of HTML found in the current webpage that is giving me no small amount of 'heardburh'.
This line appears as the third (i think .item(2)) of the page. I am trying to invoke using 'click' as you do, but this is not a button. When rendered in the webbrowser control it appears to be a submit button, but, as you see, it is not.
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Originally Posted by paxmanhorn9
Thanks very much for the info on this thread. I have learned much since finding it. Below is a line of HTML found in the current webpage that is giving me no small amount of 'heardburh'.
This line appears as the third (i think .item(2)) of the page. I am trying to invoke using 'click' as you do, but this is not a button. When rendered in the webbrowser control it appears to be a submit button, but, as you see, it is not.
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
I have a new issue. I show you the source code and my VB 2008 code. Basically I'm following what I did in my previous test to make it to work, however this website is more tricky. If someone could help me it would be great.
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
i am ghaving a go button(s) here
how can i simulate click event on the id go image here please
here is my peace of code
vb.net Code:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Hi kleinma, I was reading your posts and this is just what I am looking to do.
I cannot seem to work out how to input my log in details to a desired website using the VB form.
I know I just need to get some code from the website and manipulate it into the VB code but I am not sure how to go about this.
I would really appreciate if you could point me in the right direction.
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
I bought a script vbulletin for install it in my forum, now I have a discuzx forum on www.cristovideos.com/forum.php but I dont like this script. I trying to change my app from discuzx to vbulletin, I using this app for send pms to my members. The application is almost finished. only the last thing I need is that I can not fill the message. I still I have no forum installed and I am testing my app with another forum and I can not insert the message.
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
WebBrowser1.Navigate("URL of PAGE WITH MESSAGAE BOX")
WebBrowser1.Document.All("NAME OF MESSAGE BOX").InnerText = "TEXT TO SEND"
WebBrowser1.Document.GetElementById("NAME OF BUTTON").RaiseEvent("onclick")
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Originally Posted by ecktronic
WebBrowser1.Navigate("URL of PAGE WITH MESSAGAE BOX")
WebBrowser1.Document.All("NAME OF MESSAGE BOX").InnerText = "TEXT TO SEND"
WebBrowser1.Document.GetElementById("NAME OF BUTTON").RaiseEvent("onclick")
That should work.
Let me know how you get on.
Thanks, but I can not do this. This is the html code.
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Hi, I am new to this- I have a VB.net project in VS2005, and I added an HTML.htm window form to it. I put a button the form and I would like to have the onclick event run a vb sub. I know I need an event handler or the sub, but how do I get the name of the html button in the vb addhandler statement?
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Hi kleinma
i saw ur app . thats amazin and works fine for me !
but now i have question.
i want to click on some ads on site . but i cant find this as links in your application's getlinks() sub .
can u download this attachment and learn me how to click on this via vb.net ?
i attached html source . but forum rules deny it . plz download attachment and then rename it from test.txt to test.html !
thanks in advance
Last edited by piklio; Oct 21st, 2011 at 06:52 AM.