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

  • Home
  • SEARCH
  • 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 6172517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:24:31+00:00 2026-05-23T23:24:31+00:00

i have been fighting with this code for a few hours now…. Sample Node

  • 0

i have been fighting with this code for a few hours now….

Sample Node for results:

<div class="left vcard" sizcache="1" sizset="32">
        <h2 class="clearfix fn org url" sizcache="1" sizset="32">
            <a id="listItemTitle_11310540" href="/marcali/viragok-viragkuldes/11310540/ANDOK_MATYAS/hirdetes.mtt">ANDÓK MÁTYÁS</a> <a class="removeFromList" href="#">törlés</a>
        </h2>
        <p class="description">
            2009 decemberében nyitottuk meg az Ezerszirom Virágbolt-ot Marcaliban a Petőfi Sándor u.11-ben. Szeretettel várja a kedves vásárlókat Horváth Györgyike virágkötő, aki 15 éve kápráztatja el kreatíva...</p>
        <ul class="profession" sizcache="1" sizset="34">
            <li sizcache="1" sizset="34"><a href="/szakmak/viragok-viragkuldes/index.mtt">Virágok, virágküldés</a> </li>
        </ul>
        <div class="clearfix margined" sizcache="1" sizset="35">
            <p class="address adr">
                <span>Cím:</span> 8700 Marcali, Petőfi S. utca 11 .</p>
            <ul class="nav clearfix" sizcache="1" sizset="35">
                <li class="mapLink" sizcache="1" sizset="35"><span>-</span><a class="mapLink" href="/terkep/11310540/ANDOK_MATYAS">térképen mutat</a> </li>
                <li class="routeplanner" sizcache="1" sizset="36"><em>útvonaltervezés</em> <span>-</span> <a onclick="window.location = '/redirect.jspv?method=Redirect&amp;routePlanCount=11310540&amp;url=%2Futvonalterv.jspv%3Fto%3D%26from%3D8700+Marcali%2C+Pet%C5%91fi+S.+utca+11+.%26fromX%3D17.414611005499122%26fromY%3D46.57928886409497%26activeTab%3DrouteSearch&amp;activeTab=routeSearch'" href="#">innen</a> <strong>/</strong> <span>-</span> <a onclick="window.location = '/redirect.jspv?method=Redirect&amp;routePlanCount=11310540&amp;url=%2Futvonalterv.jspv%3Ffrom%3D%26to%3D8700+Marcali%2C+Pet%C5%91fi+S.+utca+11+.%26toX%3D17.414611005499122%26toY%3D46.57928886409497%26activeTab%3DrouteSearch'" href="#">ide</a> </li>
            </ul>
            <div class="contacts" sizcache="1" sizset="38">
                <div class="phoneHolder clearfix" sizcache="1" sizset="38">
                    <div class="dt phone">
                        Telefonszám:
                    </div>
                    <div class="dd phoneValue tel" sizcache="1" sizset="38">
                        <span>(70) 326 2843</span> <a class="clickToCall" onclick="javascript:openECS('11310540');" href="#">Hívja ingyen!</a>
                    </div>
                </div>
                <div class="webLinkHolder" sizcache="1" sizset="39">
                    <div class="dt webLink clearfix">
                        Weboldal:
                    </div>
                    <div class="dd webLinkValue" sizcache="1" sizset="39">
                        <a href="http://www.ezerszirom.hu" rel="blank,nofollow">http://www.ezerszirom.hu</a>
                    </div>
                </div>
            </div>
        </div>
    </div>

And my code:

            results = htmlDoc.DocumentNode.SelectNodes("//div[contains(@class, 'vcard')]");
            if (results != null)
            {
                foreach (var node in results)
                {
                    Response.Write(node.SelectSingleNode("//p[@class='description']").InnerText + "<br>");
                }
            }

the problem ?
since i am iterating over the results, each node should have its own description,
but i am getting the InnerText of the first node.
any idea why?

  • 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-05-23T23:24:32+00:00Added an answer on May 23, 2026 at 11:24 pm

    In XPath, // stands for “recursively search from the root”. Therefore the query doesn’t search from the node you have, but gets the first from the document.

    Try this:

    node.SelectSingleNode("descendant::p[@class='description']")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok well I have been fighting with this for a while now and have
I have been fighting all day in understanding Dijkstra's algorithm and implementing with no
Have been looking at the MVC storefront and see that IQueryable is returned from
Have been studying the file system related classes of Adobe AIR 1.5, but so
We have been using CruiseControl for quite a while with NUnit and NAnt. For
I have been experimenting with woopra.com A web analytics tool. Which requires a piece
I have been working on a web services related project for about the last
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I have been looking into IKVMing Apache's FOP project to use with our .NET
I have been searching everywhere for the following functionality in Lisp, and have gotten

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.