Questions tagged [hpple]

An XML/HTML parser for Objective-C, inspired by Hpricot.

Features

  • Easy searching by XPath (CSS selectors are planned)
  • Parses HTML (XML coming soon)
  • Easy access to tag content, name, and attributes.
105 questions
6
votes
1 answer

NSString with some html tags, how can I search for tag and get the content of url

I have a NSString with some html tags, how can I search for tag and get the content of url? I'm not sure if I must use Hpple or a simple Regex expression. In both cases can I have some example?
paul_1991
  • 245
  • 4
  • 13
5
votes
2 answers

hpple : 'libxml/tree.h' file not found

When I use hpple and build, aways show " 'libxml/tree.h' file not found " error. I have , set [Header Search Path] "${SDKROOT}/usr/include/libxml2" set [Other Linker Flag] value as "-lxml2"
Sam Niu
  • 143
  • 1
  • 10
4
votes
2 answers

Parsing inner HTML iteratively using Hpple parser and NSXMLParser

I have been working on school newspaper app for iPad platfrom. I am using NSXMLParser to get the titles, brief descriptions, and links for each article. In order to get HTML items from each parsed link, I decided to use Hpple parser. I think I am…
SerPiero
  • 53
  • 1
  • 9
4
votes
2 answers

iOS: Html parsing - how to ignore tags like a, li, etc.. within

I am currently using Hpple to parse HTML, like so: TFHpple *htmlParser = [TFHpple hppleWithHTMLData:[currentString dataUsingEncoding:NSUTF8StringEncoding]]; NSString *paragraphsXpathQuery = @"//p//text()"; NSArray *paragraphNodes =…
Zoltán Matók
  • 3,923
  • 2
  • 33
  • 64
3
votes
2 answers

How to parse HTML on iPhone using TouchXML or other libraries?

I have a dirty HTML code that is loaded from a foreign server (so I can't make a json file or clean the html code). My HTML's structure is like:
...
akashivskyy
  • 44,342
  • 16
  • 106
  • 116
3
votes
1 answer

TFHppleElement (Hpple), parsing HTML on iphone

I'm using Hpple and it's been great so far however I want to get all the divs inside another and that I can do. But then I am unable to further parse the contents (innerHTML, and in the source it is labelled innerHTML not innerText) asking for the…
Jonathan.
  • 53,997
  • 54
  • 186
  • 290
3
votes
1 answer

Hpple-All Nodes was nil

I'm very new with objective-c but good with regular C and I'm looking into iPhone development. Right now all my nodes in schools grading system are nil I know they are at the right xPath because //table[@class='grid']/tbody/tr[4]/td[16] show up…
Nxtmind
  • 57
  • 8
2
votes
1 answer

Hpple Error - "_OBJC_CLASS_$_TFHpple"

My app uses Hpple. I've included, TFHpple.h, TFHpple.m, TFHppleElement.h, TFHppleElement.m, XPathQuery.h & XPathQuery.m. Also included ${SDKROOT}/usr/include/libxml2 and -lxml2. I have this tiny bit of code: NSData *data = [[NSData alloc]…
user1126886
2
votes
1 answer

Parsing / combining nested HTML element values in the original order

I would like to know how you can parse the content of an HTML block and at the same time sustain the order of the strings as they appear in the HTML document by using this (Hpple) wrapper which works with XPath expressions. The environment is…
SnuggleUp
  • 43
  • 4
2
votes
2 answers

Hpple in Objective-C can't find a particular object (XML/HTML Parser)

For those veterans who haven't tried Hpple, it's great. It uses Xpath for searching through HTML/XML documents. It gets the job done and it's easy enough for a newbie like me to understand. However, I'm having trouble. I have this chunk of HTML: …
Aurum Aquila
  • 9,126
  • 4
  • 25
  • 24
2
votes
2 answers

XPath Text Search/Sibling Selection

This question might be a little specific but the test program im writing uses XPath to find the data i need in HTML. This piece of HTML(found here) is what im trying to parse.
user380776
  • 37
  • 6
2
votes
0 answers

HTML parsing in iOS using Hpple search href

I want to find url links in html source code. I am using Hpple for parsing the HTML. I know by giving the path we will find the url in html. For different url's the path must be changed. So i am unable to search url links. Let me explain clearly.…
vishnu
  • 715
  • 9
  • 20
2
votes
1 answer

Objective C, xpath query not working

I have next html structure I want to get content of a tag, I'm using this code NSURL *newURL = [NSURL…
SergStav
  • 750
  • 5
  • 19
2
votes
1 answer

Hpple parsing HTML with Objective-C

I've follow the tutorial from RayWendErlich to parse HTML node. I get the content from an index.html. I've try to use this method to fetch the background value. + (void)parseWithHTMLString:(NSString *)string { NSData *data = [string…
Zigii Wong
  • 7,766
  • 8
  • 51
  • 79
2
votes
2 answers

Hpple, getting text after

So I think this is my last Hpple question! I have found an entry in the HTML doc that I am parsing with Hpple. I have tried many different queries, but no luck. Here is a sample of the HTML. I can get the text staring with "Today's project" with…
Douglas
  • 2,524
  • 3
  • 29
  • 44
1
2 3 4 5 6 7