Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting DIV's with the ID = class='matches' USING HtmlAgilityPack

Posted on 2014-01-30
2
Medium Priority
?
621 Views
Last Modified: 2014-01-30
Anyone able to provide any help on what im missing after the For Each link As HtmlNode In node

	Dim hw As New HtmlWeb()
Dim doc As HtmlDocument = hw.Load("http://www.livefutbol24.com/Football/Live")
	Dim node As HtmlNode = doc.DocumentNode.SelectSingleNode("//div[@class='matches']")
For Each link As HtmlNode In node
	lblHTMLOutput.Text += link.InnerHtml
Next

Open in new window

0
Comment
Question by:runnerjp2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
Ken Butters earned 1500 total points
ID: 39820823
What are you trying to do?    

Is there more than one DIV with class='matches' that you are trying to process?

In order for you to loop through a list of nodes you have to have some sort of array to loop through.   As it stands right now, you only have a single node as a result of "selectSingleNode".

If you had used "selectNodes" instead of "selectSingleNode" the result would have been an array of nodes that you could loop through.
0
 

Author Closing Comment

by:runnerjp2005
ID: 39820937
This is what i did in the end


Dim webGet As New HtmlWeb() 'open the system
        Dim htmlDoc As HtmlDocument = webGet.Load("http://www.livefutbol24.com/Football/Live")'' get the html from the webpage

     

            For Each div As Object In htmlDoc.DocumentNode.SelectNodes("//td[@class='score']")' select all the divs within the code that contain *

            lblHTMLOutput.Text += div.InnerText & "<br>"

        Next
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question