I'm not quite clear on your question.
..Are you trying to login a website?
..Scroll to a section in the webpage that has been loaded in your vb.net WebBrowser?
..OR just extract the data from a certain section when an item is checked in your CheckedListBox?
Btw, if you are guilty for joining DaniWeb just to ask a question or two, then I am guilty for joining DaniWeb to answer a question, or two.:D
codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
Hopefully these "Html elements" have "names".
For instance, when viewing a webpage's HTML source code, and you locate something similar to:
<div class="shade"> <div class="right"> <a href="/forums/post1433269.html#post1433269" id="postcount1433269" <strong>name="4"</strong>>Permalink</a> </div> 1 Minute Ago
..you have to locate the "name=..." part of the HTML and simply add a "#" and the name, just following the original link of the page.
Example: http://www.daniweb.com/forums/thread335165.html#4
This usually targets an area of the webpage and scrolls it to the very top of the browser.
If you cannot locate the "name" of something and/or would like to "center" the content of the webpage in the WebBrowser instead of scrolling it to the top, you will have to modify the WebBrowser "DomDocument" and insert "names" in certain locations of the page to use and target.
I personally have not done much, if any DomDocument webpage editing, but hopefully this link might give you an idea on how to get started.
codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
Check out this link for a better idea on how to modify the webpage inside the WebBrowser.
Good luck with the rest.:)
EDIT:
Just wanted to add.
Why not extract the HTML and only display the selections in the WebBrowser?
codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
See if this helps.
1 TextBox (MultiLine), 1 Button.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = getUrlPageContent("http://www.daniweb.com/forums/post1433319.html")
End Sub
Function getUrlPageContent(ByVal url As String) As String
Try
Dim connect As Net.HttpWebResponse = CType(Net.HttpWebRequest.Create(url).GetResponse, Net.HttpWebResponse) '// connect.
Dim content As IO.Stream = connect.GetResponseStream()
Dim reader As New IO.StreamReader(content)
Dim htmlContent As String = reader.ReadToEnd
reader.Close() : content.Close() : connect.Close()
Return htmlContent
Catch ex As Exception
MsgBox("There was a connection problem...", MsgBoxStyle.Critical)
Return Nothing
End Try
End Function
End Class
codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
If by "slaughtering a Giraffe", you mean poke it's eyes out, then I'm out of luck. Too short and I only have a step ladder.:D
Although, one time, I was in a tree, hiding behind a leaf, and had a 50 foot ladder to poke a giraffe's eyes with:D, but that another story and probably the wrong forum for.
..The last link I have posted, was to give you an idea on how to modify the WebBrowser's content.
First you would have to replace all the similar names with your own, then probably save the content to a file somehow, and load that file with the File's location and the "#some name".
You might also have to replace links within the file saved, for example, a link that is , might have to be saved w/the URL of the page you are currently viewing, as: .
As mentioned previously, I have not done much/if any DomDocument editing, but the info I have provided so far for this thread should give you a good start.
codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
As previously mentioned, you can locate the "names" of HTML Elements to Target a section of a page, although, I have recently discovered that you can also Target the "id" of an HTML Element.
Hope this helps anyone searching for a similar solution.:)
codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384