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)
Yes; or alternatively:
Reply to This
Parent