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 7437903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:28:15+00:00 2026-05-29T10:28:15+00:00

I want to parse the following html code for my iphone application <Html> <body>

  • 0

I want to parse the following html code for my iphone application

<Html>
<body>
<div class="div_1">
    <div class="div_2">some code....</div>
    <div class="div_3">
        <div class="div_4">
            <div class="div_5">
                <p>First Paragraph</p>
                <p>Second Paragraph</p>
                <p>Third Paragraph</p>
                <p>Fourth Paragraph</p>
            </div>
        </div>
    </div>
</div>
</body>
</Html>

I am using Hpple parser for parsing this html.
The xpath query that I am using is

TFHpple *xpathParser = [[TFHpple alloc] initWithHTMLData:getHTMLData];

NSArray *elementsToSearch = [xpathParser searchWithXPathQuery:@"//div[@class='div_5']/p"];

TFHppleElement *element = [elementsToSearch objectAtIndex:0];

What I intent to get is all the p tag contents inside of div class=”div_5″.
Using the above xpath query i am only getting the first p tag contents i.e “First Paragraph”.
Am i doing anything wrong in my xpath?

  • 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-29T10:28:16+00:00Added an answer on May 29, 2026 at 10:28 am

    No. The results are all in elementsToSearch returned by -searchWithXPathQuery.

    Try to check out:

    NSLog(@"%@",[elementsToSearch description]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to parse some HTML in order to find the values of some
I'm using domDocument to parse some HTML, and want to replace breaks with \n.
I have an application written in wpf, which downloads some webpages, parses html code
i have following HTML code:- <table class=results> <tr> <td> <a href=..>link</a><span>2nd Mar 2011</span><br>XYZ Consultancy
I'm trying to parse some HTML with XPath. Following the simplified XML example below,
For an iOS application, I want to parse an HTML file that may contain
I want to use an html parser that does the following in a nice,
I want to parse the following XML document to resolve all entities in it:
I want to parse a filter string similar to the following: ((Field1 = 'red')
I want to be able to parse the following times using ParseExact() function: 01:02:03

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.