Thanks very much, that did the trick.<br><br><div class="gmail_quote">On Sun, Jun 22, 2008 at 2:15 AM, Stefan Behnel &lt;<a href="mailto:stefan_ml@behnel.de">stefan_ml@behnel.de</a>&gt; 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>
&gt; I have observed some unexpected behavior with lxml -- I looked in the bug<br>
&gt; tracker and didn&#39;t see anything that seemed related to this.<br>
&gt;<br>
&gt; daedalus:~ john$ python<br>
&gt; Python 2.5.2 Stackless 3.1b3 060516 (python-2.52:61022, Feb 27 2008,<br>
&gt; 16:52:03)<br>
&gt; [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin<br>
&gt; Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<br>
&gt;&gt;&gt;&gt; from lxml.cssselect import CSSSelector<br>
&gt;&gt;&gt;&gt; CSSSelector(&quot;div div:nth-child(5) div div div:nth-child(3) img&quot;).path<br>
&gt; &quot;descendant-or-self::div/descendant::*[name() = &#39;div&#39; and (position() = 5)]&quot;<br>
&gt;<br>
&gt; It looks like when you use the nth-child member in a CSSSelector it chops<br>
&gt; off the rest of the CSSSelector and does not process it when compiling it<br>
&gt; 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&#39;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>