© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
6 replies
langehk

❔ Scrape with HtmlAgilityPack

Hi. I'm trying to get the values on line 5 and 14.

I've tried to get the span by class. However the InnerText is just an empty string.

var desc = childNode.SelectSingleNode("(//span[contains(@class, 'ux-textspans')])");
var desc = childNode.SelectSingleNode("(//span[contains(@class, 'ux-textspans')])");


Other spans on the site has id's which makes it a lot easier, but I can't figure out how to retrieve the value, when multiple spans has the same class.
In this case there is 11 "fields/properties" listed with the same class. And I would only need some of them.

<div class=\"ux-layout-section-evo__col\">
   <div class=\"ux-labels-values__labels\">
      <div class=\"ux-labels-values__labels-content\">
         <div>
            <span class=\"ux-textspans\">Condition</span>
         </div>
      </div>
   </div>
   <div class=\"ux-labels-values__values\">
      <div class=\"ux-labels-values__values-content\">
         <div>
            <span class=\"ux-expandable-textual-display-block-inline\">
               <span data-testid=\"text\">
               <span class=\"ux-textspans\">New with tags: A brand-new, unused, and unworn item (including handmade items) in the original ... </span>
<div class=\"ux-layout-section-evo__col\">
   <div class=\"ux-labels-values__labels\">
      <div class=\"ux-labels-values__labels-content\">
         <div>
            <span class=\"ux-textspans\">Condition</span>
         </div>
      </div>
   </div>
   <div class=\"ux-labels-values__values\">
      <div class=\"ux-labels-values__values-content\">
         <div>
            <span class=\"ux-expandable-textual-display-block-inline\">
               <span data-testid=\"text\">
               <span class=\"ux-textspans\">New with tags: A brand-new, unused, and unworn item (including handmade items) in the original ... </span>
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Parsing a Link from an HTML file with HTMLAgilityPack
C#CC# / help
3y ago
✅ Beginner needs help in C# HtmlAgilityPack and Linq query
C#CC# / help
2y ago
how to scrape tweets?
C#CC# / help
3y ago
❔ ✅ Scrape all <table> </table> elements
C#CC# / help
3y ago