Predmet:vb.net webbrowser scroll down
Pokušavam da prilikom očitavanje strane dodam scroll down funkciju pa tek onda da dobijem podatke. Prilikom učitavanja web stane dobijem 15 ispisa. Potrebno mi je barem 10x više. Na svaki scroll down na strani dodaju se novi zapisi. Konkretno reč je o IG. Hoću da za određeni # dobijem linkove.
Evo i koda gde nikako ne mogu da provalim kako da mu pre očitavanja strane dodelim scrol down tj da učitam recimo 50 redova umesto trenutnih 5.
Imports System.Net
Imports System.IO
Imports System.Windows.Forms
Imports System.Text.RegularExpressions
Imports System.Xml
Imports mshtml
Public Class INSTA
Dim doc As mshtml.IHTMLDocument3
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
WebBrowser1.ScriptErrorsSuppressed = True
Dim url As String = "
https://www.instagram.com/explore/tags/fashion/"
Try
WebBrowser1.Navigate(url)
Catch ex As Exception
End Try
End Sub
Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
doc = CType(WebBrowser1.Document.DomDocument, IHTMLDocument2)
'Me.WebBrowser1.Document.Window.ScrollTo(0, 1800)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
ListBox1.Items.Clear()
Dim HTMLI As mshtml.IHTMLElement
For Each HTMLI In doc.getElementsByclassName("Nnq7C weEfm")
If HTMLI.innerHTML.Contains("a href") Then
Dim sSource As String = HTMLI.innerHTML 'String that is being searched
Dim subst As String = sSource.Substring(41, 15)
MessageBox.Show(subst.Count)
ListBox1.Items.Add(subst & vbCrLf)
End If
Next
End Sub
End Class