Manipulating WebPage Content
Learn how to create Add-Ins of all types for V3-R and share your own tutorials with others.
1 post
Page 1 of 1
Hello,
How to manipulate a webpages content do things like auto-login, form filling, locating elements and executing clicks.
This is the quickest way at this current time to do this and its a very simple replacement for any code you already use. For example if you added a webbrowser control to a form and wanted it to goto a specific page you would use:
And thats all their is to it. All you do is change "WebBrowser1" in your code to this:
Remember this code WILL change on final release so keep your source-code so you can make any changes later otherwise any add-ins you make wont work when V3R is released properly :?
How to manipulate a webpages content do things like auto-login, form filling, locating elements and executing clicks.
This is the quickest way at this current time to do this and its a very simple replacement for any code you already use. For example if you added a webbrowser control to a form and wanted it to goto a specific page you would use:
Code: Select all
And to use that same function in V3R from your add-in you simply change the code to this:WebBrowser1.Navigate("www.site.com")
Code: Select all
If you wanted to get a list of images from your webbrowser and add the links into a listbox you would use this:CType(Parent.FindForm.Controls(MainPanel).Controls(WebPanel).Controls.Item(0).Controls(Browser), WebBrowser).Navigate("www.site.com")
Code: Select all
But to do the same thing from an add-in in V3R you would change the code to this:
For Each ImageLink As HtmlElement In WebBrowser1.Document.Images
Listbox1.items.add(ImageLink.GetAttribute("src"))
Next
Code: Select all
For Each ImageLink As HtmlElement In CType(Parent.FindForm.Controls(MainPanel).Controls(WebPanel).Controls.Item(0).Controls(Browser), WebBrowser).Document.Images
Listbox1.items.add(ImageLink.GetAttribute("src"))
Next
And thats all their is to it. All you do is change "WebBrowser1" in your code to this:
Code: Select all
That simply accesses the currently visible browser on the V3R screen which gives you access to do whatever you want with it cooll;CType(Parent.FindForm.Controls(MainPanel).Controls(WebPanel).Controls.Item(0).Controls(Browser), WebBrowser)
Remember this code WILL change on final release so keep your source-code so you can make any changes later otherwise any add-ins you make wont work when V3R is released properly :?
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
1 post
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023