0

view page source Without section: enter image description here Inspect Elements With section: enter image description here

I have problem to get all elements from website by VB.Net.

for example : Instagram website

<body class style>
  <div id="react-root">    
    <section class="_9eogI E3X2T"><div></div><main class="SCxLW  o64aR " role="main"> . . . </section> . . . </div> . . . </body>

How can I get Section element ?

I try with this code: (for example)

WebBrowser1.Navigate("https://www.instagram.com/")

and in WebBrowser1.DocumentCompleted:

Dim elms As String = WebBrowser1.Document.Body.OuterHtml

but when to try get all them form WebBrowser1, Returned Body with no True Elements ?

section not receive by OuterHtml !?

I using Visual Studio 2019.

Nader MA
  • 117
  • 1
  • 5
  • 1
    where's the code you tried? please read https://stackoverflow.com/help/minimal-reproducible-example – kshkarin Nov 26 '20 at 12:35
  • `dim divElement = WebBrowser1.Document.GetElementById("react-root") dim sectionElement = divElement.Children.OfType(Of HtmlElement)().FirstOrDefault(function(elm) elm.GetAttribute("className").Equals("_9eogI E3X2T"))` – Jimi Nov 26 '20 at 14:48
  • Thanks but not working for me (div id="react-root") is loaded in WebBrowser1.Document.Body.OuterHtml, but "section" not loaded – Nader MA Nov 26 '20 at 15:27
  • Read the notes [here](https://stackoverflow.com/a/53218064/7444103) and [here](https://stackoverflow.com/a/64668045/7444103) – Jimi Nov 26 '20 at 16:54

0 Answers0