C sharp - ¿Error con el webbrowser? (visual studio)

 
Vista:

¿Error con el webbrowser? (visual studio)

Publicado por Danilo (1 intervención) el 14/03/2021 23:11:01
Estimados

¿Por qué se produce y como puedo solucionar este error?

Lo que estoy tratando de hacer, es extraer los datos del clima y presentarlos en el formulario, pero (obviamente) no me resulta y me arroja el error que se ve en la siguiente imagen.

El error se repite en las líneas 41, 42, 43 y 45.

Captura



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Imports System.Runtime.InteropServices
 
Public Class Form1
    <DllImport("user32.dll", EntryPoint:="ReleaseCapture")>
    Private Shared Sub Releasecapture()
 
    End Sub
 
    <DllImport("user32.dll", EntryPoint:="SendMessage")>
    Private Shared Sub SendMessage(ByVal hWnd As System.IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lparam As Integer)
 
    End Sub
 
    Private Sub Form1_MouseMove(sender As Object, e As MouseEventArgs) Handles MyBase.MouseMove
        Releasecapture()
        SendMessage(Me.Handle, &H112&, &HF012&, 0)
    End Sub
 
    Private Sub TextBox3_TextChanged(sender As Object, e As EventArgs) Handles TextBox3.TextChanged
 
    End Sub
 
    Private Sub BunifuFlatButton1_Click(sender As Object, e As EventArgs) Handles BunifuFlatButton1.Click
 
    End Sub
 
    Private Sub Label2_Click_1(sender As Object, e As EventArgs) Handles Label2.Click
        WindowState = FormWindowState.Minimized
    End Sub
 
    Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
        Application.Exit()
    End Sub
 
    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        Timer1.Start()
    End Sub
 
    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Try
            Label4.Text = WebBrowser1.Document.GetElementById("wob_loc").InnerText
            Label5.Text = WebBrowser1.Document.GetElementById("wob_tm").InnerText
            Label6.Text = WebBrowser1.Document.GetElementById("wob_dc").InnerText
 
            PictureBox4.ImageLocation = WebBrowser1.Document.GetElementById("wob_tci").GetAttribute("src")
 
            Label4.Visible = True
            Label5.Visible = True
            Label6.Visible = True
            PictureBox4.Visible = True
            Label7.Visible = True
 
        Catch ex As Exception
 
        End Try
    End Sub
 
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("https://www.google.cl/?gws_rd=ssl#q=clima+")
    End Sub
End Class
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder