NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
XPath has it (Score:1)
It's possible, but I'm not sure how to handle multiple predicates. For the simple case, it looks like this:
"div[/*/span[@class='storyicons']]"
which pulls out all the divs which have a grandchild which is a span with a class of 'storyicons'.
Re: (Score:1)
You can put multiple predicates on a single path step. Something like
/foo[@bar='baz'][@quux='qux']is completely valid (and logically equivalent to/foo[@bar='baz' and @quux='qux']).Re: (Score:1)
ah!
So in the example above, it would be something like
"//div[@class='full'][.//div/div[@class='details']/a[@href='"+href+"']]"
(I think)
Re:XPath has it (Score:1)
Err, wait, no. Where did that
.//in your second predicate come from? It would be eitheror
You want those nested DIVs and As as direct child nodes of each other and of the node in question – you’re not looking for that subtree anywhere further down.
Reply to This
Parent
Re: (Score:1)
Ah, okay -- I'm not that familiar with XPath yet.