Closed Thread Icon

Topic awaiting preservation: getNode using css selector? Pages that link to <a href="https://ozoneasylum.com/backlink?for=8968" title="Pages that link to Topic awaiting preservation: getNode using css selector?" rel="nofollow" >Topic awaiting preservation: getNode using css selector?\

 
Author Thread
smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 12-10-2003 18:04

Hi guys, hope you are all well and feeling festive,

My problem is like this, basically I want to be able to find an element(s) on a page using a css selector.

So it might be something like 'div .menu #firstEntry span' now how can I use that to find the target span?

I feel it is gonna be some DOM trickery here but I can't for the life of me work it out.

I would like to be able to write something like getElementsBySelector('div .menu #firstEntry span')

I think it can be done, I'm sure someone has done it or similar but I dunno where.

I would appreciate any help guys,

Thanks and enjoy the Christmas season,

Jon

visit my CryoKinesis Online Gallery

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 12-10-2003 19:00

smonkey: Simon Willison have implemented a getElementsBySelector function that exactly does what you want, and much more since it allows the regex on attribute's value.

Hope that helps,

Mathieu "POÏ" HENRI

« BackwardsOnwards »

Show Forum Drop Down Menu