0

I'm trying to read messages sent by strangers on Omegle. A random "chat with strangers" website.

I've displayed the DocumentText of my webbrowser (called Omegle) in a textbox called OmegleHTML:

 Private Sub Omegle_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles Omegle.DocumentCompleted
    OmegleHTML.Text = Omegle.DocumentText
    Me.Text = Omegle.Document.Title
End Sub

I've also did a bit of coloring to make things a bit clear:

OmegleHTML

Now using this HTML code, I've been able to do simple tasks I need such as simulating clicks. But what I'm mainly interested in like I said is extracting the string a stranger says from the HTML code, sadly I'm unable to find what I need in the HTML code I've exported to the textbox, however when I inspect the message element in Chrome:

Chrome element inspecting

This is the exact code I need to display in my textbox in order to extract the logitem message a stranger types, now what am I doing wrong? I noticed that when I press Ctrl + U (page source) in chrome, it displays the same exact code my textbox displays, aslo missing the logitems I need, so if I'm not looking for the page source, what should I look for?

Remon Ramy
  • 167
  • 1
  • 11

1 Answers1

1

The content is written out dynamically using JavaScript. So it isn't part of the page source itself, but is part of the "state" of the page.

See this answer for some details. How to get rendered html (processed by Javascript) in WebBrowser control?

Community
  • 1
  • 1
Tim
  • 2,878
  • 1
  • 14
  • 19
  • I was just about to post that I found my solution while trying things out in code, `OmegleHTML.Text = Omegle.Document.Body.OuterHtml` does the job just fine. Anyways this question you posted seems to hold the same answer so thanks! Also thanks for explaining it to me. – Remon Ramy Mar 08 '15 at 22:59