-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
I meant Visual Studio v.6.
And,yes.
You see the problem is that i usually go to this site with many images.Now i don't need all those images except for one which is present in a certain web page which is the reason i can't disable all images on my browser since i need to keep the image activated on one single webpage on that site but don't need other images on that website.
The images take alot of my internet speed you see.
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
@klienma
Thanks for this tutorial..I figured it how to auto fill textbox in form and solve my problem..
I got a question for you.
Is it possible to collect data in this page with table. link here
Is t possible to collect and view the data from tables into a ListView control in winForm?
Instead of viewing page in webbrowser. i just want to use listview.
Thanks for the help..
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
kleinma!!!
4 years and you are still helping! You are amazing. Just finished reading 13 pages and what an amazing person you are! Wow! Never come across a guru like you!
Joined this forum to ask for help!
I have a web browser control through which I am able to pass the user name and password and invoke a submit event. The problem now is that as soon as a login happens, a PDF file is downloaded and this appears in a File Download dialog box. The point is that I am trying to build a windows application which is automated. So there is no room for popups or dialog boxes. What I actually need to do is to capture this pdf download onto the local disk without the File Dialog intervention.
I have struggled with this for a month. No luck! I pray to god that u read this post and help me!
Thanks for all the great work you are doing!
Cheers,
iceqb
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
ahh my friend flattery will get you no where with me ;)
When you log into the page, is the page that you end up at actually a PDF document? Or do you end up at a normal webpage which spawns a PDF in a popup window? One thing I find odd is that you are getting a file download dialog for a PDF document. That usually only happens when you don't have a PDF reader installed. When I navigate to a PDF either in IE or the browser control, it simply opens up either in the browser directly, or in adobe reader/acrobat.
So what is the exact behavior going on ?
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Thanks for the quick response. Yes, like you guessed, I do not have pdf reader installed on a server machine. And as u said again, post authentication, I end up with a pdf file. So is it possible to capture this download into a file within a browser control. (There will be no instances of PDF reader on the machine)!
Please help!
Thank you a million!
Cheers,
IceQB
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
BTW, missed out to mention. I really meant what I said. and wasn't intended to turn out as flattery. :-P
Thanks once again!
Cheers,
IceQB
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Well, I don't know the ins and outs of how your exact web app works that you are trying to do this for. If it works how I assume it does, you may be able to do something like this:
in the navigating event of the browser, you can cancel navigation. So IF in fact this event fires when the PDF doc is navigated to, you could grab the URL, and then cancel navigation, and download the file manually since you would have the URL to it. Depending on if authentication would block this or not, I guess that it something you would have to test.
Something along these lines:
note it assumes the URL of the PDF actually ends with pdf (there is no extra data after in the URL)
Code:
Private Sub WebBrowser1_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
If e.Url.ToString.EndsWith("pdf") Then
Dim myFileURL As String = e.Url.ToString
My.Computer.Network.DownloadFile(e.Url.ToString, "C:\myfile.pdf")
e.Cancel = True
End If
End Sub
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Awesom. Thanks a lot pal. Will try an post. Thanks once again! :)
Cheers,
IceQB
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
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 kleinma,
i am able to login to a web page based on your above code....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")
End If
End Sub
-
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")
End If
End Sub
-
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.
Is there a more elegant way to do this in VB6?
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Is it possible to use VB Control (textbox & button) instead of loading external html to submit a form?
-
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:(
Code:
<input type="hidden" id="referrer" name="referrer" value="116" autocomplete="off" /><input type="hidden" id="challenge" name="challenge" value="f6c75d9cda8d09a31ccc9a59d3e1ab7a" autocomplete="off" /><input type="hidden" id="md5pass" name="md5pass" value="" autocomplete="off" /><div class="reg_btn clearfix"><span class="UIButton UIButton_Green UIFormButton"><input value="Sign Up" type="submit" class="UIButton_Text" onclick="return run_with(this, ["reg-util"], function() {RegUtil.getInstance().ajax_validate_data({ignore: ['captcha']}, "registration_container", "1");});" /></span>
pls help me:$
I use VB 2008
and i tired
.InvokeMember("submit")
System.Windows.Forms.SendKeys.Send("ENTER")
but doesnt work.
many thanks
Quote:
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
Very intresting article, what about filling in Java textareas?
-
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
SELECT class=userPerpage onchange=changeRecordsPerPage() name=pageSize><OPTION
value=10>10</OPTION> <OPTION value=25 selected>25</OPTION> <OPTION
value=50>50</OPTION> <OPTION value=100>100</OPTION></SELECT>
abi is the name of my web window
ABI.Document.All.Item("pageSize").InnerText = 50
also tried the innertext is quotes, i have also tried the following
ABI.Document.All.Item("pagesize").InvokeMember("click")
any ideas, many thanks
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
well i solved that problem, by doing this
ABI.Document.All("pagesize").SetAttribute("value", "50")
simple once i found it out
i now have another issue, the form has two buttons called go, crap i know.
this is the one i want to run
<INPUT class=button id=Save style="WIDTH: 30px" onClick="return validate('GO');" type=submit value=Go name=Go>
this is the one i dont want to run
<INPUT class=button id=searchButton onClick="return getQuickSearchProjectDetail();" type=button value=Go name=Go>
can you refer to the id as i see one is called searchbutton and the other is called save, i had tried just running the javacode but that didnt work
thanks im running vb2008
-
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
<INPUT value=6598 type=hidden name=CRN10><INPUT value=2802123 type=hidden name=CARRYUNAME>
but when run on other computers (all running XP sp2 and above, some Vista)
<INPUT type=hidden value=6598 name=CRN10><INPUT value=2802123 type=hidden name=CARRYUNAME>
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
Would you mind posting a sample App?
-
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 :blush:
I successfuly work out some part of it btw :)
Thanks
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Thanks, im glad I found this. Auto completing web forms is something im really interested in.
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Hi Kleinma,
if ur still following this thread... plz.. need ur help.... :confused:
not sure if this is where I should post :o 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.
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Hi CAVU,
Thanks for the quick response.. but i guess.. yours is a windows app rite.. :confused: i need it for a web app. :o
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
i hope u you upload vb.net 2008 version soon, been waiting for that release
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Hi Klein,
I am trying to make an Image Downloader. Your app on this post no.1 is got all the features that I need but I am using VB 2010.
Can you please make something in this version???
Thanks in advance,
Trusted
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Opening the sln file in VS2010 will convert it to that version. No need to post new code.
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
this is exactly what im looking for but i cant open your attachment :-/ and iv got VS2010
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
wow... that was nice kleinma
I think u can help me here, i'm trying to make a similar app :
http://www.vbforums.com/showthread.p...getelementbyid
let me give u a quick overview
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 !
p.s. - i'm using VS2005
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
-
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.
(HTML element:
<input type="image" name="loginPrimeAccess" src="/images/btn_go_to_primeaccess_BEC0C2.gif" border="0" tabindex="3"><br>
In the code below I have commented out the TRY in order to see the error message.
Here is the code I have so far:
Dim s As IHTMLElement
Me.Browser.Document.GetElementsByTagName("Input").Item(0).SetAttribute("Value", "037882")
Me.Browser.Document.GetElementsByTagName("Input").Item(1).SetAttribute("Value", "atrium")
s = Me.Browser.Document.GetElementsByTagName("image").Item(1)
'Try
Me.Browser.Document.GetElementsByTagName("image").Item(2).InvokeMember("Click")
'Catch
'End Try
How can I get the login to go?
Thanks,
Gary
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Quote:
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.
(HTML element:
<input type="image" name="loginPrimeAccess" src="/images/btn_go_to_primeaccess_BEC0C2.gif" border="0" tabindex="3"><br>
In the code below I have commented out the TRY in order to see the error message.
Here is the code I have so far:
Dim s As IHTMLElement
Me.Browser.Document.GetElementsByTagName("Input").Item(0).SetAttribute("Value", "037882")
Me.Browser.Document.GetElementsByTagName("Input").Item(1).SetAttribute("Value", "atrium")
s = Me.Browser.Document.GetElementsByTagName("image").Item(1)
'Try
Me.Browser.Document.GetElementsByTagName("image").Item(2).InvokeMember("Click")
'Catch
'End Try
How can I get the login to go?
Thanks,
Gary
Hi Gary,
Im glad you have found this thread useful, would you be able to tell me what Webpage your trying to login to so i can take a better look?
Thanks
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
The site is www.MyMls.com
Thanks,
Gary
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Klein just i want an advise which i worried from many days
is it possible to extract the data from a web page (.do file) to a data table
page contains a table
and the name of the person,USERid,statement period
any advise please
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
i tried to do the submit button but it doesnt work because the source page doesn't have the submit button name or ID. can someone help me.
<td>
<label class="uiButton uiButtonConfirm" for="u847036_3">
<input value="Login" tabindex="4" type="submit" id="u847036_3" />
</label>
</td>
Code:
DirectCast(GetCurrentWebForm.item("Login", 0), mshtml.HTMLButtonElement).click()
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
NVM
I got it
GetCurrentWebForm.submit()
-
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.
<div>
<span class="req">Posting Title:</span><br>
<input class="req" tabindex="1" type="text"
name="U2FsdGVkX18xNzU1MTE3NY6yhOpP3KeiEsxnPNFPyI1_AiYA:ILvewO7Kx_XF:D_4OTEL2-L5vlxg"
id = "U2FsdGVkX18xNzU1MTE3NY6yhOpP3KeiEsxnPNFPyI1_AiYA:ILvewO7Kx_XF:D_4OTEL2-L5vlxg"
size="30" maxlength="70"
value="">
</div>
DirectCast(GetCurrentWebForm.item("U2FsdGVkX18xNzU1MTE3NY6yhOpP3KeiEsxnPNFPyI1_AiYA:ILvewO7Kx_XF:D_4 OTEL2-L5vlxg"), mshtml.HTMLTextAreaElement).value = txtData.Text
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
The web site www.evony.com triggers the DocumentComplete event 5 times!
how can this be?
-
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
With Me.WebBrowser1
.Document.All.Item("CrewID").InnerText() = "UBL1425"
' .Document.All.Item(13).InvokeMember("click") ' no action
.Document.GetElementById("searchgo.gif").InvokeMember("click") ' no action
'' button names used
''searchgo.gif
'' "go"
End With
End Sub
:wave:
-
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.
Thanks,
ecktronic
-
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.
I trying with this code :
"wbForumpm.Document.Window.Frames("vB_Editor_001").Document.Body.InnerHtml = txtPMBody.Text"
and this code:
"'Body set
If Unit.GetAttribute("name") = "message" Then
Unit.SetAttribute("value", txtPMBody.Text)
End If"
But not work. I think that you can do it God willing .
I bought vbulletin 4 like http://www.webtalkforums.com/private...wpm&u=90020380 .
Thanks advanced.God bless you.
-
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")
That should work. :)
Let me know how you get on.
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Quote:
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.
Code:
<!-- message area -->
<!-- / Editor Scripts --><div id="vB_Editor_001" class="blockrow texteditor">
<div class="editor">
<div class="editor_textbox_container smilie">
<div class="editor_textbox editor_textbox_smilie">
<textarea id="vB_Editor_001_editor" name="message" rows="8" cols="60" autocomplete="off" tabindex="1"></textarea>
</div>
</div>
<div class="editor_smiliebox">
<ul class="smiliebox floatcontainer" id="vB_Editor_001_smiliebox">
<li>
<div class="table">
<div class="tablecell">
<img src="images/smilies/frown.png" id="vB_Editor_001_smilie_1209" alt=":(" title="Frown" border="" />
</div>
</div>
</li>
<li>
<div class="table">
<div class="tablecell">
<img src="images/smilies/mad.png" id="vB_Editor_001_smilie_1210" alt=":mad:" title="Mad" border="" />
</div>
</div>
</li>
<li>
<div class="table">
<div class="tablecell">
<img src="images/smilies/redface.png" id="vB_Editor_001_smilie_1211" alt=":redface:" title="Redface" border="" />
</div>
</div>
</li>
<li>
<div class="table">
<div class="tablecell">
<img src="images/smilies/rolleyes.png" id="vB_Editor_001_smilie_1212" alt=":rolleyes:" title="Rolleyes" border="" />
</div>
</div>
</li>
<li>
<div class="table">
<div class="tablecell">
<img src="images/smilies/smile.png" id="vB_Editor_001_smilie_1213" alt=":)" title="Smile" border="" />
</div>
</div>
</li>
<li>
<div class="table">
<div class="tablecell">
<img src="images/smilies/tongue.png" id="vB_Editor_001_smilie_1214" alt=":p" title="Tongue" border="" />
</div>
</div>
</li>
<li>
<div class="table">
<div class="tablecell">
<img src="images/smilies/wink.png" id="vB_Editor_001_smilie_1215" alt=";)" title="Wink" border="" />
</div>
</div>
</li>
<li>
<div class="table">
<div class="tablecell">
<img src="images/smilies/biggrin.png" id="vB_Editor_001_smilie_1205" alt=":D" title="Biggrin" border="" />
</div>
</div>
</li>
<li>
<div class="table">
<div class="tablecell">
<img src="images/smilies/confused.png" id="vB_Editor_001_smilie_1206" alt=":confused:" title="Confused" border="" />
</div>
</div>
</li>
<li>
<div class="table">
<div class="tablecell">
<img src="images/smilies/cool.png" id="vB_Editor_001_smilie_1207" alt=":cool:" title="Cool" border="" />
</div>
</div>
</li>
<li>
<div class="table">
<div class="tablecell">
<img src="images/smilies/eek.png" id="vB_Editor_001_smilie_1208" alt=":o" title="Eek" border="" />
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
<input type="hidden" name="wysiwyg" id="vB_Editor_001_mode" value="1" />
<!-- / message area -->
Also this code :
<body class="forum" contenteditable="true" spellcheck="true" style="height: auto;">
<br type="_moz">
</body>
I already used:
message
vB_Editor_001_editor
But not work. Thanks in advanced.
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Oops, I didn't realise you were using HTML sorry!
Hope you manage to figure this out.
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
No, I am using VB 2010 but this is the html of the vbulletin, I need help for find the right html element to use it in my app.
Quote:
Originally Posted by
ecktronic
Oops, I didn't realise you were using HTML sorry!
Hope you manage to figure this out.
-
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?
-
1 Attachment(s)
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
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
i get the picture on website, then i need my application auto text values of the picture...
can u help me with this problem??
this my code for get the image:
Code:
Dim doc As IHTMLDocument2 = WebBrowser1.Document.DomDocument
Dim imgRange As IHTMLControlRange = CType(doc.body, HTMLBody).createControlRange
For Each img As IHTMLImgElement In doc.images
If img.GetAttribute("src").ToString.Contains("image.php") Then
imgRange.add(img)
imgRange.execCommand("Copy", False, Nothing)
PictureBox1.Image = Clipboard.GetDataObject.GetData(DataFormats.Bitmap)
Exit For
End If
Next
http://www.vbforums.com/attachment.p...1&d=1325308898
My Problen on Thread
http://www.vbforums.com/showthread.p...54#post4111754
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
@afdoal you need to use a decaptcha service or delve into image processing (OCR)
Can anyone help on how to simulate typing, which is a combination of onkeydown, onkeypress and onkeyup events?
regards
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
@kleinma:
I have some trouble determining the completed event.
Code:
' Load the url
Private Sub frmTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim orgurl As String = "url"
wb.Navigate(orgurl)
End Sub
'Document completed event
Private Sub webBrowser_DocumentCompleted(sender As Object, e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles wb.DocumentComplete
'Change the value in the txt box, and submit
DirectCast(GetCurrentWebDoc.getElementById("ctl00_mainContent_Live3Price1_NEW_wdcDate_dateInput_TextBox"), mshtml.HTMLInputElement).value = "22/06/2012"
DirectCast(GetCurrentWebDoc.getElementById("ctl00_mainContent_Live3Price1_NEW_Button1"), mshtml.HTMLInputElement).click()
'AFTER submit, content will be loaded. The submit button call AJAX to load data into table. Url unchanged.
'But the ready state already be "Complete"
'I'v tried WebBrowserReadyState.Complete and SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE , but get the same result, their state will be "Complete", even when browser still loading the content.
If wb.ReadyState = WebBrowserReadyState.Complete Then
MessageBox.Show("Done")
End If
End Sub
How to check if browser has completely loaded (after AJAX)?
I have to parse the source code (after AJAX), and need to check the state of browser
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Hi all ,
can any one help me with this :
a program takes value from txt document and fills it in to online registration form. so i dont need it to do in manualy over and over again . I just change the txt file every time i need to create new .
lets say . "mr bob brown". have to be filled in to online registration form . lets say register.jabber.org.
so i just need to pres button "register" on a webpage . or better the program to have a button too :) after fill execute (but offcourse it will be hard to avoid the HUMAN CHECK box ) but still i need help in this :) I dont need passing by check box . i need to auto fill . "roboform" similer to this but simpler .
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
I need help filling out the region and the category this web page. http://www.inetgiant.com/item/new It wants you to physically click it. I got everything else i need to work. Please help.
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
Was wondering if you updated this to 2005 browser. I use default webbrowser (extended) that I found on some scratch code. Its actually 2005 IE. It doesn't want to convert my html source to mshtml .
Code:
Try
Dim GetCurrentWebDoc As mshtml.HTMLDocument = DirectCast(wb.Document, mshtml.HTMLDocument)
Dim MyDiv As mshtml.HTMLDivElement = DirectCast(GetCurrentWebDoc.getElementsByTagName("img"), mshtml.HTMLDivElement)
If MyDiv.getAttribute("className") = "vam hand" Then
MessageBox.Show(MyDiv.getAttribute("onclick"))
End If
Catch
MsgBox(ErrorToString, MsgBoxStyle.Critical)
End Try
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
SOLVED
VS 2010 converts automaticly.
Quote:
Originally Posted by
kleinma
All the time I see people asking how to autofill in forms on webpages or how to click a button in a webpage that is hosted in the webbrowser control, via VB code.
It is really not all that difficult, once you get around the casting of types to the correct kind when using the COM reference.
This example project highlights the following manipulations (as well as opening the door to manipulate just about anything on a webpage that is possible)
* Getting a value of an HTML input element
* Setting a value of a HTML input element
* Getting a value of an HTML text area
* Setting a value of a HTML text area
* Set HTML radio buttons selected or not
* Click an HTML button
* Submit an HTML Form
* Get the sources for all images in HTML document
* Get and display all the links in the HTML document
* Alter non form elements (like changing the color of a DIV tag)
* Getting values from an HTML Select element (value and selected index)
* Display page HTML source
* Run a javascript that is in the HTML Page
* click a checkbox in an HTML form
* Print the current page (with printer selection dialog)
* Added 8/24/2006 - Highlight webpage text via code
This specific example code is done using
Visual Studio 2005 (VB.NET)
However I use the COM WB Control, not the built in .NET 2.0 WB Control (because its functionality is rather limited)
I also use a reference to the MSHTML scripting engine, which is what allows you to parse a webpage into all its elements so you can manipulate them.
Please let me know if you have any questions/comments/suggestions.
I can add more functionality examples if someone can think of one....
Hello
This looks to be exactly what i need to start on a tool at the company i work for, do you have it on VB 2010? i am having dificulties to open it.
Any idea how to solv this?
Thank you any way, im sure i´ll find a way to make it work.
Best regards.
Blitz
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
The project page "TestPage.htm" shows signs of a budding star in web design. Some real layout talent there.
On a more serious note, I'm sure I speak for many when I say thank you. Your post is well written and it has obviously helped many of us who still have a lot to learn. I've used your code as a starting point on more than one project. Again, thank you kleinma.
-
Nice
-
Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control
I need to fill this text area but the value of class and ID changes:
<div aria-labelledby="255" role="textbox" g_editable="true" class="df b-K b-K-Xb URaP8 editable" id=":78.f" contenteditable="true"></div>
How can I have success ?