Dictionary 配列にある項目の数を取得したい:
しかし、次のようにすると、 4が得られないようです。
Dim showNumber As Integer = tmpShows.Length
私が持っている辞書のコードは次のとおりです。
Dim all = New Dictionary(Of String, Object)()
Dim info = New Dictionary(Of String, Object)()
info!Station = .SelectSingleNode(".//span[@class='channel']").ChildNodes(3).ChildNodes(2).InnerText
info!Shows = From tag In .SelectNodes(".//a[@class='thickbox']")
Select New With {.Show = tag.Attributes("title").Value, .Link = tag.Attributes("href").Value}
Dim tmpShows = all.Item(info!Station)
Dim showNumber As Integer = tmpShows.Length
探している4の長さを取得するために何が欠けていますか?
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)()
skipFirstShow = False
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[2]").Attributes("style").Value
If InStr(style.ToLower, "width: 0px;") <> 0 Then skipFirstShow = True
info!Shows = From tag In .SelectNodes(".//a[@class='thickbox']")
Select New With {.Show = tag.Attributes("title").Value, .Link = tag.Attributes("href").Value}
'Select New With {.Show = tag.Attributes("title").Value, .Link = tag.Attributes("href").Value}
End With
all.Add(info!Station, info.Item("Shows"))
theLogoURL(theCount) = "https://example.org" & 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)