ねえ、私は次の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&height=260&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&height=260&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>
次のコードを使用して、現在いくつかのアイテム(/images/channel_logos/WRCB.png、3、WRCB、Inside Edition)を取得できます。
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)
ただし、<BR> WRCB </ P> </ SPAN> <SPAN style ='PADDING-BOTTOM:0px;の後に幅を取得するための秘訣を見つけることができません。パディング-左:0px; 幅:0px;
WIDTH:0pxを取得しようとしています。それだけ。
その値を取得するために、上記のコードで何を変更できますか?