Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8796883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:43:27+00:00 2026-06-13T23:43:27+00:00

Hey all I am looking for a way to get this HTML code: <DIV

  • 0

Hey all I am looking for a way to get this HTML code:

<DIV class=schedule_block>
<DIV class=channel_row><SPAN class=channel>
<DIV class=logo><IMG src='/images/channel_logos/WGNAMER.png'></DIV>
<P><STRONG>2</STRONG><BR>WGNAMER </P></SPAN>

using the HtmlAgilityPack.

I have been trying this:

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(1).ChildNodes(0).InnerText
      info!Station = .SelectSingleNode(".//span[@class='channel']").ChildNodes(1).ChildNodes(2).InnerText
   End With
.......

I can get the Logo but it comes up with a blank string for the Channel and for the Station it says

Index was out of range. Must be non-negative and less than the size of
the collection.

I’ve tried all types of combinations:

info!Station = .SelectSingleNode(".//span[@class='channel']").ChildNodes(1).ChildNodes(1).InnerText
info!Station = .SelectSingleNode(".//span[@class='channel']").ChildNodes(1).ChildNodes(3).InnerText
info!Station = .SelectSingleNode(".//span[@class='channel']").ChildNodes(0).ChildNodes(1).InnerText
info!Station = .SelectSingleNode(".//span[@class='channel']").ChildNodes(0).ChildNodes(2).InnerText
info!Station = .SelectSingleNode(".//span[@class='channel']").ChildNodes(0).ChildNodes(3).InnerText

What do I need to do in order to correct this?

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:43:29+00:00Added an answer on June 13, 2026 at 11:43 pm

    If the whitespace is actually there, it counts as a child node. So:

    Dim channelSpan = .SelectSingleNode(".//span[@class='channel']")
    
    info!Channel = channelSpan.ChildNodes(3).ChildNodes(0).InnerText
    info!Station = channelSpan.ChildNodes(3).ChildNodes(2).InnerText
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all, looking to see if theres a way to easily include external html
Hey all, looking to reduce the code on my c# if statements as there
hey guys im looking for a way to show all mp3 files in a
hey all, im looking for a way of catching a button held down event
Hey all looking throughout all of stackoverflow this looks like a common error i
Hey all, I'm looking for a fresh set of eyes to check out this
Hey all, I am looking for a way to query my database table only
Hey all, Looking for feedback if anyone has a good way to, when you
Possible Duplicate: Form validation Hey all, I'm just looking for what the correct way
Hey all I'm extremely new to jquery and ajax and I'm looking for some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.