Explain more please.
The code dont work . . .Code:Dim htmlDocument As HtmlDocument = Me.WebBrowser1.Document Dim htmlElementCollection As HtmlElementCollection = htmlDocument.Links Dim link2 As HtmlElementCollection link2 = WebBrowser1.Document.GetElementsByTagName("href") For Each img As HtmlElement In link2 ListBox1.Items.Add(img.GetAttribute("href")) Next
I want the code Gets all the Links of the Webpage and add to listbox
thanks
Explain more please.
I want the code gets all the links in the Web and add to listbox..
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
But this will get the links only of the tag "a" ..Code:Dim Links As HtmlElementCollection = WebBrowser1.Document.GetElementByTagName("a") For Each Link As HtmlElement in Links Listbox1.Items.Add(Link.GetAttribute("href").ToString) Next
You cant just edit it to get the links of everytags, there are alots of ways..
Sorry my english.
Last edited by Lyoto Machida; 06-10-2011 at 11:00 AM.
Well Jason Im at My father PC, I cant download it now . . . And im borring so im making a new tool :S
Also thanks Lyoto
But. . . You said just get elements of "a" I change It to "www" no?
Code:Dim htmlElementCollection As HtmlElementCollection = htmlDocument.All Dim link2 As HtmlElementCollection link2 = WebBrowser1.Document.Links For Each img As HtmlElement In link2 varto = ListBox1.Items.Count ListBox1.Items.Add(img.GetAttribute("href")) Label2.Text = varto & " " & "Links" Label2.ForeColor = Color.Green
Last edited by alvaritos; 06-10-2011 at 11:11 AM.
Just make a loop trough all elements of the page, And make like a check, If the attribute "href" is not null , then add it to the listbox..
Well solved but anyway thanks!
Okay marked solved.
[highlight=vb.net]
ListBox1.Items.AddRange(WebBrowser1.Document.GetEl ementsByTagName("a").Cast(Of HtmlElement)().Select(Function(h As HtmlElement) h.GetAttribute("href").ToString()).ToArray())
[/highlight]
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)