Prev: Finding similar results with php from mysql
Next: CSS - Image or object Slide left/right and fade in using jquery
From: Gary on 9 May 2010 04:31 If I have a document containing, say: <html> <body> <table> <tbody> <tr> <td><font ...>foo1</font></td> <td><font ...>bar1</font></td> </tr> <tr> <td> <font ...>foo2</font> </td> <td> <font ...>bar2</font> </td> </tr> .... How do I get at "bar2"? I tried everything, based on an xpath from Firebug (Firefox plugin), but kept getting NULL.
From: Peter Lind on 9 May 2010 04:46 On 9 May 2010 10:31, Gary <php-general(a)garydjones.name> wrote: > If I have a document containing, say: > <html> > Â <body> > Â <table> > Â <tbody> > Â Â <tr> > Â Â <td><font ...>foo1</font></td> > Â Â <td><font ...>bar1</font></td> > Â Â </tr> > Â Â <tr> > Â Â <td> > Â Â Â <font ...>foo2</font> > Â Â </td> > Â Â <td> > Â Â Â <font ...>bar2</font> > Â Â </td> > Â Â </tr> > ... > > How do I get at "bar2"? I tried everything, based on an xpath from > Firebug (Firefox plugin), but kept getting NULL. > try //table//font - that should give you all the font elements in table elements. Given your layout, you're then looking for $list->item(3) Regards Peter -- <hype> WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 </hype>
From: "Gary ." on 10 May 2010 09:34
On 5/9/10, Peter Lind wrote: > On 9 May 2010 10:31, Gary wrote: >> If I have a document containing, say: >> <html> .... >> >> How do I get at "bar2"? I tried everything, based on an xpath from >> Firebug (Firefox plugin), but kept getting NULL. >> > > try //table//font - that should give you all the font elements in > table elements. Given your layout, you're then looking for > $list->item(3) I found out what my problem was. Something, somewhere - the plugin, Firefox itself, something - decided to "help me" by inserting TBODY elements into the xpath which just plain did not exist in the original HTML. |