Сначала создайте приложение консоли
Module Module1
Sub Main()
Console.Title = "Youtube Fetch Views"
Dim thread As New System.Threading.Thread(AddressOf FetchViews)
thread.Start()
Console.ReadKey()
End Sub
Sub FetchViews()
Dim request As Net.HttpWebRequest = TryCast(Net.WebRequest.Create("https://www.youtube.com/watch?v=6MTXs8T7Omg"), Net.HttpWebRequest)
Dim response As Net.HttpWebResponse = TryCast(request.GetResponse(), Net.HttpWebResponse)
Dim dataStream As IO.Stream = response.GetResponseStream()
Dim reader As New IO.StreamReader(dataStream)
Dim responseFromServer As String = reader.ReadToEnd()
reader.Close()
response.Close()
Dim str As Text.RegularExpressions.Match = Text.RegularExpressions.Regex.Match(responseFromServer, "<div class=""watch-view-count"">(.*?)</div>")
Dim views As String = Str.Groups(1).Value
Console.ForegroundColor = ConsoleColor.Green
Console.WriteLine(views)
End Sub
End Module