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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:17:00+00:00 2026-06-09T17:17:00+00:00

What I am trying to do is parse multiple sections of a page on

  • 0

What I am trying to do is parse multiple sections of a page on a site. Here is what I am doing:

NSURL *tutorialsUrl = [NSURL URLWithString:@"http://www.cetsp.com.br/"];
NSData *tutorialsHtmlData = [NSData dataWithContentsOfURL:tutorialsUrl];

TFHpple *tutorialsParser = [TFHpple hppleWithHTMLData:tutorialsHtmlData];

NSArray *holder;

NSString *tutorialsXpathQueryString = @"//div[@class='info oeste']/a/h4";
NSString *tutorialsXpathQueryString2 = @"//div[@class='info norte']/a/h4";
NSString *tutorialsXpathQueryString3 = @"//div[@class='info centro']/a/h4";
NSString *tutorialsXpathQueryString4 = @"//div[@class='info leste']/a/h4";
NSString *tutorialsXpathQueryString5 = @"//div[@class='info sul']/a/h4";

NSArray *oeste = [tutorialsParser searchWithXPathQuery:tutorialsXpathQueryString];
NSArray *norte = [tutorialsParser searchWithXPathQuery: tutorialsXpathQueryString2];
NSArray *centro = [tutorialsParser searchWithXPathQuery:tutorialsXpathQueryString3];
NSArray *leste = [tutorialsParser searchWithXPathQuery:tutorialsXpathQueryString4];
NSArray *sul = [tutorialsParser searchWithXPathQuery: tutorialsXpathQueryString5];

holder = [[NSArray alloc] initWithObjects:norte, oeste, centro,leste,sul, nil];

for (NSArray *array in holder) {

    for (TFHppleElement *element in array) {

        NSLog([[element firstChild] content]);
    }
}

The console logs 5 different correct results, but as you can see my code is quite tedious. So how can I get all the contents of the multiple tags?

Thanks!

  • 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-09T17:17:01+00:00Added an answer on June 9, 2026 at 5:17 pm

    Hpple uses XPathQuery to parse HTML. If you want to search for any class you can use:

    @"//div[@class=*]/a/h4"
    

    or if you only want those specific classes you can try:

    @"//div[@class='info oeste']/a/h4 | //div[@class='info norte']/a/h4 | //div[@class='info centro']/a/h4"
    

    The syntax is documented here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse this JSOn with multiple entries of node tag: { nodes:
I'm trying to parse a single string and get multiple chunks of data out
What I'm trying to do is to parse multiple entries from xml to html!
I'm trying to parse json in as3 that has multiple arrays like this: {
I'm trying to parse words which can be broken up over multiple lines with
I'm trying to parse a feed with multiple events and its only returning me
I'm trying to parse product names that have multiple abbreviates for sizes. For example,
I am trying to parse emails with python email.parser. When my email contains multiple
I have multiple xml files that I am trying to parse using JQuery. So
I'm trying parse the follow XML file: <root>Root <pai>Pai_1 <filho>Pai1,Filho1</filho> <filho>Pai1,Filho2</filho> </pai> <pai>Pai_2 <filho>Pai2,Filho1</filho>

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.