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
1
vote
2 answers

Using wildcards for xpath query in the hpple library for iOS

I am using the hpple library to parse an html document. The document looks something like Promo - 20 Apr 2014 Promo - 19 Apr 2014
tbag
  • 1,268
  • 2
  • 16
  • 34
1
vote
0 answers

Parsing HTML hpple replacing [element raw]

I'm having an issue using hpple library for parsing an HTML content. I want to use textkit to display a good html content. So here's my issue. I want to replace all image or video tags with my own tag and then instert it with textkit on an…
Pwyll28
  • 117
  • 11
1
vote
0 answers

Parsing a HTML alike code in Objective-C

I'm new to Objective-C programming and while I'm trying to parse SAMI code I found some difficulties with using Hpple to properly parse some section from the file. SAMI body code syntex follows

This is Subtitle

Reonasa
  • 11
  • 2
1
vote
0 answers

parsing html using xpath hpple is always returning an empty string

I am doing the following: NSData *htmlData = [[NSString stringWithString:sHTML] dataUsingEncoding:NSUTF8StringEncoding]; TFHpple * xpathParser = [[TFHpple alloc] initWithHTMLData:htmlData]; NSArray * elements = [xpathParser…
LilMoke
  • 3,176
  • 7
  • 48
  • 88
1
vote
1 answer

Get text from HTML with hpple

the part that i am having trouble with reading is this html code:

Hvorfor flager busserne i dag?

Idag den 26. august flager busserne ikke

My code in xcode looks like this: NSString *tutorialsXpathQueryString1 =…
JMIT
  • 169
  • 2
  • 15
1
vote
1 answer

Objective-C HTML parsing. Get all text between tags

I am using hpple to try and grab a torrent description from ThePirateBay. Currently, I'm using this code: NSString *path =…
user2272641
  • 131
  • 1
  • 3
  • 16
1
vote
1 answer

hpple xpath problems

I am using hpple to parse an HTML document. I followed Ray Wenderlich’s tutorial and have everything working fine for their example file. However, I need to change it up a bit to read a certain HTML file for my friends blog. The file is more…
Douglas
  • 2,524
  • 3
  • 29
  • 44
1
vote
0 answers

Hpple not able to identify tag

Hello I ank using this is my current path NSString *XpathQ2 = @"//table[@class='grid']/tbody"; when i try to change it to NSString *XpathQ2 = @"//table[@class='grid']/tbody/tr"; or NSString *XpathQ2 = @"//table[@class='grid']/tbody/tr[4]"; the…
Nxtmind
  • 57
  • 8
1
vote
1 answer

Objective C Hpple to get commented element information

I'm starting my iPhone programming adventure, with a simple HTML scraping. I'm using the Hpple library to do the job, and I have a question... Suppose I have the following html to parse...
A
B…
Nuno Gonçalves
  • 6,202
  • 7
  • 46
  • 66
1
vote
0 answers

iOS getting HTML title tag

I'm trying to get the title tag of an HTML, and am using Hpple to parse the HTML. For some reason, I'm getting null when i use this code NSURL *Url = self.webview.request.URL; NSData *HtmlData = [NSData dataWithContentsOfURL:Url]; TFHpple…
Chris Loonam
  • 5,735
  • 6
  • 41
  • 63
1
vote
1 answer

Keep Repeating Enumeration in iOS and Xpath search

So I'm using HPPLE to do some Xpath queries in a iOS app that needs to do some basic web scraping of a few sites. Right now everything works pretty good, but I wanted to see if there's another, more elegant way of doing what I'm doing. Currently…
Sal Aldana
  • 1,235
  • 4
  • 17
  • 39
1
vote
2 answers

Get the href value using XPath/Hpple/Objective-C

I tried everything that makes (and doesn't make) sense for me. I have the following html code which I try to parse with XPath in Objective-C:
HAS
  • 19,140
  • 6
  • 31
  • 53
0
votes
2 answers

XPath - Attributes selection

I have this code:

Text1

Text1

With Hpple (XPath), I need to read the first

, and the second, but I dont know how to do this. Maybe…

user1126886
0
votes
1 answer

Hpple - Reading a tag with an attribute

I'm trying to parse a XML, <![CDATA[TITLE]]> Using Hpple, I'm trying to read the NSArray *array = [xpathParser searchWithXPathQuery:@"//entry/title[@type='html']"]; But the returned value is null.…
user1126886
0
votes
3 answers

Unable to get data from a div tag using HTML parsing (hpple) in iPhone

I am trying to parse the below link using hpple: http://www.decanter.com/news/wine-news/529748/mimimum-pricing-opponents-slam-cameron-speech Code: - (void)parseURL:(NSURL *)url { NSData *htmlData = [NSData dataWithContentsOfURL:url]; …
Dee
  • 1,887
  • 19
  • 47