CoderNever (09-30-2009),Houston (10-01-2009),[MPGH]Liz (09-30-2009)
im going to post a bunch of code on webbrowser automating that i used to use when i just started learnign before i got into webrequest
Click A Button
IF ID ExistsCode:webbrowser1.Document.All("Button ID").InvokeMember("click")
Click Button Just By Value Of ItCode:If WebBrowser1.Document.All("ID") Is Nothing Then Else MsgBox("ID exsits") End If
Click Check boxCode:Private Function GetBtnByValue(ByVal value As String) As HtmlElement For Each d As HtmlElement In Webbrowser1.Document.GetElementsByTagName("input") If (d.GetAttribute("type").ToLower = asd.Text Or d.GetAttribute("type").ToLower = "submit") Then If (d.GetAttribute("value") = value) Then Return d Exit For End If End If Next End Function Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click GetBtnByValue("go").InvokeMember("Click") End Sub
Click all Check box's with same valueCode:Dim outer As String = WebBrowser1.Document.All("PersistentCookie").OuterHtml WebBrowser1.Document.All("Check Box ID").OuterHtml = outer.Remove(outer.Length - 2) + " checked>"
Fill Textbox In WebbrowserCode:For Each InputBx As HtmlElement In WebBrowser1.Document.GetElementsByTagName("input") If (InputBx.GetAttribute("type").ToLower = "radio") AndAlso (InputBx.GetAttribute("value").ToLower = "Value Of Check Box") Then InputBx.InvokeMember("Click") End If Next
Get Text From Textbox In WebbrowserCode:For Each HTMLele As HtmlElement In WebBrowser1.Document.All If HTMLele.Name = "ID" Then HTMLele.SetAttribute("value", "someemail@somewhere.comValue") End If Next
Stop IE Pop upsCode:Dim text As String = WebBrowser1.Document.All("Textbox ID).GetAttribute("value") TextBox1.Text = text
Check URLCode:WebBrowser1.ScriptErrorsSuppressed = True
webbrowser containsCode:If WebBrowser1.Url.ToString = "URL" Then
Webbrowser statusCode:If WebBrowser1.DocumentTex*****ntains("Phrase") Then Else End If
Show Page SourceCode:TextBox1.Text = WebBrowser1.StatusText
Download PageCode:TextBox1.Text = webBrowser.Document.body.innerHTML
Code:Dim MyWebClient As New System.Net.WebClient() TextBox1.Text = MyWebClient.DownloadString("URL")
CoderNever (09-30-2009),Houston (10-01-2009),[MPGH]Liz (09-30-2009)
oouuuhh pretty, whats it do
If anyone claims to be me via any other source outside of MPGH private or visitor messages, IT'S NOT ME!
They are trying to trick or scam you. Report them immediately and PM me here for verification.
"Don’t confuse my personality with my attitude. My personality is who I am. My attitude depends on who you are." — Frank OceanModerator: 5/2009-10/2009 | GMod: 10/2009-10/2010 | Staff Administrator: 10/2010-Present
I do not do requests via PM. Post in the appropriate section.
Stupid/Pointless Private messages = SPAM, SPAM = BAN.
oh ouh, would this work with grease monkey?
If anyone claims to be me via any other source outside of MPGH private or visitor messages, IT'S NOT ME!
They are trying to trick or scam you. Report them immediately and PM me here for verification.
"Don’t confuse my personality with my attitude. My personality is who I am. My attitude depends on who you are." — Frank OceanModerator: 5/2009-10/2009 | GMod: 10/2009-10/2010 | Staff Administrator: 10/2010-Present
I do not do requests via PM. Post in the appropriate section.
Stupid/Pointless Private messages = SPAM, SPAM = BAN.
[MPGH]Liz (09-30-2009)
gotcha, thanks ^^
If anyone claims to be me via any other source outside of MPGH private or visitor messages, IT'S NOT ME!
They are trying to trick or scam you. Report them immediately and PM me here for verification.
"Don’t confuse my personality with my attitude. My personality is who I am. My attitude depends on who you are." — Frank OceanModerator: 5/2009-10/2009 | GMod: 10/2009-10/2010 | Staff Administrator: 10/2010-Present
I do not do requests via PM. Post in the appropriate section.
Stupid/Pointless Private messages = SPAM, SPAM = BAN.
I need a more clear idea of this... Im very confused. Im still learning<------------chooby
No Pixie, it wont work on RuneScape, since RuneScape is made in Java.
And your webbrowser would never be able to acces the data in the RuneScape client.
Last edited by K4GE; 09-30-2009 at 05:00 PM.
Pixie (09-30-2009)
If I got this right , These are codes there interact with "Tools > Webbrowser" that you can use to furfill a simple task such as...Filling in a title textbox...so say you wanted to go to this page "https://www.mpgh.net/forum/newreply.php?do=newreply&noquote=1&p=######" and Fill in "Title:" With Web Codes , then you can set it to click a button in your Visual Basic Browser and then it will automatically fill it in with the data , which can be very useful for saving password information and getting your details typed in on a click of a button.
Thanks , Was Very Useful information
Well yes thats true, but you won't be able to do stuff like: filling forms, clicking buttons (without telling the location (X-Y)), and so on...
But yes, what your saying is possible.