Xpath extract equipment

it gives me an error "Object reference not set as an instance of an object"
What is "it"? Don't expect us to tell you what's wrong with your code if you refuse to show us your code. Also, don't just send us off to a web site and expect us to work out what you actually want from it. Show us the specific data you're working with and explain exactly what you want out of it. You need to provide a FULL and CLEAR explanation of the problem. Don't expect us to spend time working things out that you already know. Do all you can to help us help you and then we'll be more likely to help you.
 
I'm sorry or I remembered to put the code here my problem

Try

Dim url As WebRequest = WebRequest.Create("Jornada 19 de Primera División - laliga,la liga santander,liga española,primera division españa,primera división española,liga españa,primera,primera division,liga,la liga - Resultados de Fútbol")
Dim respose As WebResponse = url.GetResponse
Dim PAGINA As New StreamReader(respose.GetResponseStream())
Dim MIHTML As String = PAGINA.ReadToEnd()

Dim html = New HtmlDocument()
html.LoadHtml(MIHTML) 'pasando tu string con el HTML

Equipos_Local = (html.DocumentNode.SelectSingleNode(".//html/body/div[6]/div[3]/div[10]/div/div[4]/div[1]/div[2]/table/tbody/tr[1]/td[3]/a[2]").InnerText)

TxtBoxEquipo.text = Equipos_Local

Catch ex As Exception

MsgBox(ex.Message)

End Try
 
Use id attributes whenever you can to narrow the search path, for example "//table[@id=""tabla1""]"
 
Maybe add the part after table? ...]/tbody....
 
something like that?

(html.DocumentNode.SelectSingleNode(".//html/body/div[6]/div[3]/div[10]/div/div[4]/div[1]/div[2]/table/tbody/tr[1]/td[3]/a[2]").InnerText)

"//table[@id=""tabla1""]/tbody/tr[1]/td[3]/a[2]"
 
Back
Top