Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get elements of html,xml by hpple ( xpath )?
    text
    copied!<p>please use hpple(xpath), This is a followup to my previous question: </p> <pre><code>http://stackoverflow.com/questions/6723244/iphone-how-to-select-this-label </code></pre> <p>How can I get the number in <code>seekVideo(number)</code>? For example:</p> <pre><code>&lt;a href="#" class="transcriptLink" onclick="seekVideo(2000); return false;" </code></pre> <p>I want to get "2000". </p> <p>I have tried:</p> <pre><code>NSArray *elements = [xpathParser search:@"//div[@id='transcriptText']/div/p/number(substring-before(substring-after(@onclick, '('), ')'))"]; </code></pre> <p>But that's not right. How should i do this?</p> <p>If someone can you use the code framework named hpple(xpath) , it would be great.</p> <p>this is my code for get text ,now how to change for getting number?????</p> <pre><code> #define WebSite @"http://www.ted.com/talks/matt_cutts_try_something_new_for_30_days.html" - (void)setLoadData { NSData *siteData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:WebSite]]; TFHpple *xpathParser = [[TFHpple alloc] initWithHTMLData:siteData]; NSArray *elements = [xpathParser search:@"//div[@id='transcriptText']/div/p/a[number(substring-before(substring-after(@onclick, '('), ')')) &gt;2000]/text()"]; NSMutableArray *arr = [[NSMutableArray alloc] init]; for (TFHppleElement *element in elements) { NSString *strs = [element content]; NSLog(@"cc: %@", strs); [arr addObject:strs]; NSLog(@"arr: %@", arr); } self.listData = arr; [arr release]; [xpathParser release]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload