runnerjp_1 0 Newbie Poster

Hi i have a xml file on the web and i would like to scrape it to get the relevant information

<M MId="1195772" LId="34923" _LId="34921" OId="569" SId="5" KId="122" LNr="2" C0="1392715800" ML="1" HId="13106" GId="5996" W="" HN="Musfat Banyas" GN="Omyyah Idlib" HRC="" HRCi="1" GRC="" GRCi="0" Info="" S1="1-1" S2="1-0" MStan="1" OTv="" L="0" A="3" Ao="11"/>

I would like to scrape every M and get the value of HN GN S1 S2

I have scraped html pages using the below but i believe the xml pages are different?

Imports System.Net
Imports System.IO
Imports System.Xml
Imports HtmlAgilityPack


Partial Class Grayhounds_home
    Inherits System.Web.UI.Page
    '  Gettodaysmatches(cominguptable, "https://www.betfair.com/sport/football?selectedTabType=TODAY", ".//div[contains(@class, 'match event-information ui-event')]", ".//span[@class='home-team-name']", ".//span[@class='away-team-name']", ".//span[@class='ui-no-score']")

    Private Sub Grayhounds_home_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim webGet As New HtmlWeb() 'open the system
        Dim htmlDoc As HtmlDocument = webGet.Load("http://www.futbol24.com/matchDayXml/?Day=20140218") '' get the html from the webpage
        Dim coll As HtmlNodeCollection = htmlDoc.DocumentNode.SelectNodes("//m")
        If coll IsNot Nothing Then
            For Each div As Object In coll ' select all the divs wi
            test.Text = div.Attributes("HN").Value
            Next
        End If
    End Sub
End Class
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.