Question

Hey all i have the following HTML:

<DIV class=channel_row><SPAN class=channel>
<DIV class=logo><IMG src='/images/channel_logos/WRCB.png'></DIV>
<P><STRONG>3</STRONG><BR>WRCB </P></SPAN><SPAN style='PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 0px; PADDING-RIGHT: 0px; HEIGHT: 42px; PADDING-TOP: 0px' class=time>
<DIV style='MARGIN: 10px'><A class=thickbox title='Inside Edition' href='/tv/info/?program_id=20474&amp;height=260&amp;width=612' jQuery171012058627296475072='8'>Inside Edition</A> 
<P class=schedule_flags><STRONG class=new_flag>New</STRONG>, <STRONG class=cc_flag>CC</STRONG>, <STRONG class=stereo_flag>Stereo</STRONG></P></DIV></SPAN><SPAN style='PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 490px; PADDING-RIGHT: 0px; HEIGHT: 42px; PADDING-TOP: 0px' class=time>
<DIV style='MARGIN: 10px'><A class=thickbox title='The Voice' href='/tv/info/?program_id=20475&amp;height=260&amp;width=612' jQuery171012058627296475072='9'>The Voice</A> 
<P class=schedule_flags><STRONG class=live_flag>Live</STRONG>, <STRONG class=new_flag>New</STRONG>, <STRONG class=cc_flag>CC</STRONG>, <STRONG class=stereo_flag>Stereo</STRONG></P></DIV></SPAN></DIV>

I can get a few items right now (/images/channel_logos/WRCB.png, 3, WRCB, Inside Edition) using the following code:

    Dim all = New Dictionary(Of String, Object)()
    For Each channel In doc.DocumentNode.SelectNodes(".//div[@class='channel_row']")
        Dim info = New Dictionary(Of String, Object)()

        With channel
            info!Logo = .SelectSingleNode(".//img").Attributes("src").Value
            info!Channel = .SelectSingleNode(".//span[@class='channel']").ChildNodes(3).ChildNodes(0).InnerText
            info!Station = .SelectSingleNode(".//span[@class='channel']").ChildNodes(3).ChildNodes(2).InnerText

            Dim style As String = .SelectSingleNode(".//span").Attributes("style").Value

            info!Shows = From tag In .SelectNodes(".//a[@class='thickbox']")
                         Select New With {.Show = tag.Attributes("title").Value}
        End With

        all.Add(info!Station, info.Item("Shows"))
        theLogoURL(theCount) = "http://epbfi.com" & Trim(info.Item("Logo"))
        theChannelNum(theCount) = Trim(info.Item("Channel"))
        theStationCallLetters(theCount) = Trim(info.Item("Station"))

        Dim Shows As String = ""
        Dim ShowsDetail As String = ""
        Dim tmpShows = all.Item(info!Station)

However, i am unable to find the trick to getting the width after < BR>WRCB < /P>< /SPAN>< SPAN style='PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; WIDTH: 0px;

I'm looking to get WIDTH: 0px; only.

What can i modify in my code above in order to get that value?

Was it helpful?

Solution

I think you could try this:

.SelectSingleNode(".//span[2]").Attributes("style").Value
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top