Thanks very much, that did the trick.<br><br><div class="gmail_quote">On Sun, Jun 22, 2008 at 2:15 AM, Stefan Behnel <<a href="mailto:stefan_ml@behnel.de">stefan_ml@behnel.de</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
thanks for the report.<br>
<div><div></div><div class="Wj3C7c"><br>
John Evans wrote:<br>
> I have observed some unexpected behavior with lxml -- I looked in the bug<br>
> tracker and didn't see anything that seemed related to this.<br>
><br>
> daedalus:~ john$ python<br>
> Python 2.5.2 Stackless 3.1b3 060516 (python-2.52:61022, Feb 27 2008,<br>
> 16:52:03)<br>
> [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin<br>
> Type "help", "copyright", "credits" or "license" for more information.<br>
>>>> from lxml.cssselect import CSSSelector<br>
>>>> CSSSelector("div div:nth-child(5) div div div:nth-child(3) img").path<br>
> "descendant-or-self::div/descendant::*[name() = 'div' and (position() = 5)]"<br>
><br>
> It looks like when you use the nth-child member in a CSSSelector it chops<br>
> off the rest of the CSSSelector and does not process it when compiling it<br>
> down to an xpath.<br>
<br>
</div></div>That was an indentation bug (i.e. wrong block-level) in the selector parser,<br>
which made it stop short after a (pseudo) function with parameters.<br>
<br>
Here's a fixed version for 2.0:<br>
<br>
<a href="http://codespeak.net/svn/lxml/branch/lxml-2.0/src/lxml/cssselect.py" target="_blank">http://codespeak.net/svn/lxml/branch/lxml-2.0/src/lxml/cssselect.py</a><br>
<br>
or for 2.1 beta:<br>
<br>
<a href="http://codespeak.net/svn/lxml/trunk/src/lxml/cssselect.py" target="_blank">http://codespeak.net/svn/lxml/trunk/src/lxml/cssselect.py</a><br>
<font color="#888888"><br>
Stefan<br>
</font></blockquote></div><br>