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
2
votes
1 answer

TFHpple only parse texts before
tag

This is the HTML:

Every Sunday, our Chef proposes a buffet high in color.
A brunch either classic or on a theme for special events
Every Sunday at the restaurant

And Here is my code: NSString *u = [[NSString alloc]…
Ahmed
  • 33
  • 5
2
votes
1 answer

Hpple not able to parse HTML

I'm using Hpple to parse HTML and it seems that it doesn't recognize it is actually XML, which it should (XCode debugger shows this variable isXML = (BOOL) NO and it doesn't collect any data). How do I fix this? This is my code (they're may be other…
sinθ
  • 11,093
  • 25
  • 85
  • 121
2
votes
0 answers

Html parsing using hpple

i need your help. This is the first time i try to parse HTML and i am running through some problems. I followed Rays Tutorial about HTML parsing. He uses hpple. The file i want to parse is a lot more complicated than his. I want to excract some…
Pantelis Proios
  • 1,359
  • 1
  • 20
  • 32
2
votes
0 answers

hpple parsing table from html

I have a problem with "Hpple". I'm parse html file, and I want to get the entire table, but the result I get (null). My code in Objective-C: -(void)loadTutorials { // 1 paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,…
IlyaKharlamov
  • 479
  • 1
  • 4
  • 10
2
votes
1 answer

Getting the HTML tags in hpple as well as text?

The code below takes all of the text from a certain div. Is it possible for me to take all the text from the div as well as the html attributes? So it also adds all of the

's and

's to the string, myString? //trims string from…
Lewis
  • 159
  • 10
1
vote
0 answers

Parsing HTML with hpple

I have some experience with parsing a simple HTML but not a large ones. I am making an iphone app with multiple tableView that use hpple to parse HTML from a web server. My question is: how do I use hpple in my application? Should I use multiple…
adellam
  • 811
  • 2
  • 9
  • 16
1
vote
2 answers

XPath XML query

I have trouble working with xml query. Below is the xml document. All I need to do is to display the text inside the cdata section. I wrote this query: /item/title/text(), but it crashed and doesn't work. <![CDATA[Envious at Envie! 50% off…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/iphone" class="post-tag grid--cell" title="show questions tagged 'iphone'" rel="tag">iphone</a> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/xpath" class="post-tag grid--cell" title="show questions tagged 'xpath'" rel="tag">xpath</a> <a href="../../questions/tagged/hpple" class="post-tag grid--cell" title="show questions tagged 'hpple'" rel="tag">hpple</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jul 25 '11 at 08:27">asked Jul 25 '11 at 08:27</time> <a href="../../users/860994/kevin" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/860994.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="kevin" /> </a> <div class="s-user-card--info"> <a href="../../users/860994/kevin" class="s-user-card--link">kevin</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">129</li> <li class="s-award-bling s-award-bling__silver" title="2 silver badges">2</li> <li class="s-award-bling s-award-bling__bronze" title="11 bronze badges">11</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-5255850"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>1</strong></span> <div class="viewcount">vote</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/5255850/hpple-html-parse-iphone-sdk-help" class="question-hyperlink">hpple html parse iphone sdk help?</a></h3> <div class="excerpt">I want to parse html.. so I have found some sample code over: http://blog.objectgraph.com/index.php/2010/02/24/parsing-html-iphone-development/ it uses hpple to parse html... but there is one problem this application is constantly crashing for some…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/iphone" class="post-tag grid--cell" title="show questions tagged 'iphone'" rel="tag">iphone</a> <a href="../../questions/tagged/html-parsing" class="post-tag grid--cell" title="show questions tagged 'html-parsing'" rel="tag">html-parsing</a> <a href="../../questions/tagged/deprecated" class="post-tag grid--cell" title="show questions tagged 'deprecated'" rel="tag">deprecated</a> <a href="../../questions/tagged/hpple" class="post-tag grid--cell" title="show questions tagged 'hpple'" rel="tag">hpple</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Mar 10 '11 at 05:29">asked Mar 10 '11 at 05:29</time> <a href="../../users/655995/tushar-chutani" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/655995.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Tushar Chutani" /> </a> <div class="s-user-card--info"> <a href="../../users/655995/tushar-chutani" class="s-user-card--link">Tushar Chutani</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1,522</li> <li class="s-award-bling s-award-bling__gold" title="5 gold badges">5</li> <li class="s-award-bling s-award-bling__silver" title="27 silver badges">27</li> <li class="s-award-bling s-award-bling__bronze" title="57 bronze badges">57</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-34061756"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>1</strong></span> <div class="viewcount">vote</div> </div> </div> <div class="status "> <strong>2</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/34061756/parse-html-into-nsdictionary" class="question-hyperlink">Parse Html into NSDictionary</a></h3> <div class="excerpt">i'm trying to read an RSS using NSXMLParser and that's ok. This is the Xml that return from this RSS: http://www.mymovies.it/cinema/xml/rss/?id=roma (for lazy people who don't will click the link, I leave an extract :) ) <item> <title>Dio esiste e…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ios" class="post-tag grid--cell" title="show questions tagged 'ios'" rel="tag">ios</a> <a href="../../questions/tagged/objective-c" class="post-tag grid--cell" title="show questions tagged 'objective-c'" rel="tag">objective-c</a> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/rss" class="post-tag grid--cell" title="show questions tagged 'rss'" rel="tag">rss</a> <a href="../../questions/tagged/hpple" class="post-tag grid--cell" title="show questions tagged 'hpple'" rel="tag">hpple</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Dec 03 '15 at 09:05">asked Dec 03 '15 at 09:05</time> <a href="../../users/2032103/ilario" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/2032103.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Ilario" /> </a> <div class="s-user-card--info"> <a href="../../users/2032103/ilario" class="s-user-card--link">Ilario</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">5,979</li> <li class="s-award-bling s-award-bling__gold" title="2 gold badges">2</li> <li class="s-award-bling s-award-bling__silver" title="32 silver badges">32</li> <li class="s-award-bling s-award-bling__bronze" title="46 bronze badges">46</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-32917911"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>1</strong></span> <div class="viewcount">vote</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/32917911/parse-tr-block-into-uitablecell" class="question-hyperlink">Parse <tr> block into UITableCell</a></h3> <div class="excerpt">I'm using Hpple to parse HTML of a website onto my app. The parsing is working great but instead of all the contents of the tr block to be in one cell, each of the td elements in the tr block are table cells of their own. Here's what I mean. The TR…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/html" class="post-tag grid--cell" title="show questions tagged 'html'" rel="tag">html</a> <a href="../../questions/tagged/ios" class="post-tag grid--cell" title="show questions tagged 'ios'" rel="tag">ios</a> <a href="../../questions/tagged/xcode" class="post-tag grid--cell" title="show questions tagged 'xcode'" rel="tag">xcode</a> <a href="../../questions/tagged/hpple" class="post-tag grid--cell" title="show questions tagged 'hpple'" rel="tag">hpple</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Oct 03 '15 at 01:07">asked Oct 03 '15 at 01:07</time> <a href="../../users/3697839/halesenchanted" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/3697839.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="HalesEnchanted" /> </a> <div class="s-user-card--info"> <a href="../../users/3697839/halesenchanted" class="s-user-card--link">HalesEnchanted</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">615</li> <li class="s-award-bling s-award-bling__gold" title="2 gold badges">2</li> <li class="s-award-bling s-award-bling__silver" title="9 silver badges">9</li> <li class="s-award-bling s-award-bling__bronze" title="20 bronze badges">20</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-28788724"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>1</strong></span> <div class="viewcount">vote</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/28788724/parse-xml-in-xcode-with-hpple" class="question-hyperlink">Parse xml in Xcode with Hpple</a></h3> <div class="excerpt">I have some xml that looks like this: <menu> <day name="monday"> <meal name="BREAKFAST"> <counter name="Bread"> <dish> <name>Plain Bagel <info name="Plain Bagel"> …</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ios" class="post-tag grid--cell" title="show questions tagged 'ios'" rel="tag">ios</a> <a href="../../questions/tagged/objective-c" class="post-tag grid--cell" title="show questions tagged 'objective-c'" rel="tag">objective-c</a> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/hpple" class="post-tag grid--cell" title="show questions tagged 'hpple'" rel="tag">hpple</a> <a href="../../questions/tagged/tfhpple" class="post-tag grid--cell" title="show questions tagged 'tfhpple'" rel="tag">tfhpple</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Mar 01 '15 at 00:38">asked Mar 01 '15 at 00:38</time> <a href="../../users/3961428/iqueqiorio" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/3961428.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="iqueqiorio" /> </a> <div class="s-user-card--info"> <a href="../../users/3961428/iqueqiorio" class="s-user-card--link">iqueqiorio</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1,149</li> <li class="s-award-bling s-award-bling__gold" title="2 gold badges">2</li> <li class="s-award-bling s-award-bling__silver" title="35 silver badges">35</li> <li class="s-award-bling s-award-bling__bronze" title="78 bronze badges">78</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-27590822"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>1</strong></span> <div class="viewcount">vote</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/27590822/hpple-with-complex-html-in-ios" class="question-hyperlink">Hpple with complex HTML in iOS</a></h3> <div class="excerpt">How I can parse complex html with many child tags with hpple in iOS. I cant find any good and complex tutorial or any good documentation about this library. with simple parsing there is no any problem. the html example is: <div class="post…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/html" class="post-tag grid--cell" title="show questions tagged 'html'" rel="tag">html</a> <a href="../../questions/tagged/ios" class="post-tag grid--cell" title="show questions tagged 'ios'" rel="tag">ios</a> <a href="../../questions/tagged/parsing" class="post-tag grid--cell" title="show questions tagged 'parsing'" rel="tag">parsing</a> <a href="../../questions/tagged/hpple" class="post-tag grid--cell" title="show questions tagged 'hpple'" rel="tag">hpple</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Dec 21 '14 at 15:30">asked Dec 21 '14 at 15:30</time> <a href="../../users/1435064/jack-daniel" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1435064.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Jack Daniel" /> </a> <div class="s-user-card--info"> <a href="../../users/1435064/jack-daniel" class="s-user-card--link">Jack Daniel</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">2,397</li> <li class="s-award-bling s-award-bling__gold" title="8 gold badges">8</li> <li class="s-award-bling s-award-bling__silver" title="33 silver badges">33</li> <li class="s-award-bling s-award-bling__bronze" title="58 bronze badges">58</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-27433797"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>1</strong></span> <div class="viewcount">vote</div> </div> </div> <div class="status "> <strong>0</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/27433797/parsing-html-ios-using-hpple-help-required" class="question-hyperlink">Parsing Html ios using hpple help required</a></h3> <div class="excerpt">I'm currently trying to parse the following content from a HTML website: < div class="box"><br> < script>...< /script><br> "mytext"<br> < br><br> "mytext"<br> < br><br> "mytext"<br> < script>...< /script><br> < div class="cube">< /div><br> <…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/html" class="post-tag grid--cell" title="show questions tagged 'html'" rel="tag">html</a> <a href="../../questions/tagged/ios" class="post-tag grid--cell" title="show questions tagged 'ios'" rel="tag">ios</a> <a href="../../questions/tagged/parsing" class="post-tag grid--cell" title="show questions tagged 'parsing'" rel="tag">parsing</a> <a href="../../questions/tagged/hpple" class="post-tag grid--cell" title="show questions tagged 'hpple'" rel="tag">hpple</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Dec 11 '14 at 22:42">asked Dec 11 '14 at 22:42</time> <a href="../../users/4351913/wajdi-mnasri" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/4351913.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Wajdi Mnasri" /> </a> <div class="s-user-card--info"> <a href="../../users/4351913/wajdi-mnasri" class="s-user-card--link">Wajdi Mnasri</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">11</li> <li class="s-award-bling s-award-bling__bronze" title="3 bronze badges">3</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-26546263"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>1</strong></span> <div class="viewcount">vote</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/26546263/get-table-data-from-html-using-hpple" class="question-hyperlink">Get table data from html using hpple</a></h3> <div class="excerpt">I am trying to parse the following website so I display the data like this on iOS: Saturday 6th September Causeway Bond's Glen Raceway 11:00am RO Two Day Meeting Two Separate Days An example of the website: <div…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ios" class="post-tag grid--cell" title="show questions tagged 'ios'" rel="tag">ios</a> <a href="../../questions/tagged/objective-c" class="post-tag grid--cell" title="show questions tagged 'objective-c'" rel="tag">objective-c</a> <a href="../../questions/tagged/xpath" class="post-tag grid--cell" title="show questions tagged 'xpath'" rel="tag">xpath</a> <a href="../../questions/tagged/hpple" class="post-tag grid--cell" title="show questions tagged 'hpple'" rel="tag">hpple</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Oct 24 '14 at 10:35">asked Oct 24 '14 at 10:35</time> <a href="../../users/2687200/harg" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/2687200.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Harg" /> </a> <div class="s-user-card--info"> <a href="../../users/2687200/harg" class="s-user-card--link">Harg</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">365</li> <li class="s-award-bling s-award-bling__silver" title="2 silver badges">2</li> <li class="s-award-bling s-award-bling__bronze" title="18 bronze badges">18</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-24370231"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>1</strong></span> <div class="viewcount">vote</div> </div> </div> <div class="status "> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/24370231/how-to-parse-html-content-in-ios" class="question-hyperlink">How to parse HTML content in iOS ?</a></h3> <div class="excerpt">I am developing an iOS app for iPhone. I am getting json data from a url. Now, the data contains html tags which i want to parse, I an using Hpple lib to do so. Being new to ios development, I am not able to figure out how to do so. Data contains…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/ios" class="post-tag grid--cell" title="show questions tagged 'ios'" rel="tag">ios</a> <a href="../../questions/tagged/xcode5" class="post-tag grid--cell" title="show questions tagged 'xcode5'" rel="tag">xcode5</a> <a href="../../questions/tagged/html-parsing" class="post-tag grid--cell" title="show questions tagged 'html-parsing'" rel="tag">html-parsing</a> <a href="../../questions/tagged/hpple" class="post-tag grid--cell" title="show questions tagged 'hpple'" rel="tag">hpple</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Jun 23 '14 at 15:54">asked Jun 23 '14 at 15:54</time> <a href="../../users/3751662/daljeet" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/3751662.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Daljeet" /> </a> <div class="s-user-card--info"> <a href="../../users/3751662/daljeet" class="s-user-card--link">Daljeet</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1,573</li> <li class="s-award-bling s-award-bling__gold" title="2 gold badges">2</li> <li class="s-award-bling s-award-bling__silver" title="20 silver badges">20</li> <li class="s-award-bling s-award-bling__bronze" title="40 bronze badges">40</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/hpple_page=1" rel="prev" title="Go to page 1">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/hpple_page=1" rel="" title="Go to page 1">1</a> <div class="s-pagination--item is-selected">2</div> <a class="s-pagination--item" href="../../questions/tagged/hpple_page=3" rel="" title="Go to page 3">3</a> <a class="s-pagination--item" href="../../questions/tagged/hpple_page=4" rel="" title="Go to page 4">4</a> <a class="s-pagination--item" href="../../questions/tagged/hpple_page=5" rel="" title="Go to page 5">5</a> <a class="s-pagination--item" href="../../questions/tagged/hpple_page=6" rel="" title="Go to page 6">6</a> <a class="s-pagination--item" href="../../questions/tagged/hpple_page=7" rel="" title="Go to page 7">7</a> <a class="s-pagination--item" href="../../questions/tagged/hpple_page=3" rel="next" title="Go to page 3"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>