[lxml-dev] lxml cssselect
Stefan Behnel
stefan_ml at behnel.de
Wed Jul 15 08:36:56 CEST 2009
Hi,
Brandon Low wrote:
> On 2009-07-14 (Tue) at 13:11:25 -0700, Mary Lei wrote:
>> Can I use cssselect to select a set of input tags
>> with image
>>
>> <input name="etsstop" value="1" src="nph-bgExec_files/top.png"
>> type="image">
>>
>> for img in root.cssselect('input'):
>> ...
>>
>> works fine but
>> for img in root.cssselect('input type="image"'):
>> ...
>> sends lxml spinnning.
>
> root.cssselect('input[type="image"]')
>
> is the syntax you need
Right, here are the docs:
http://www.w3.org/TR/CSS2/selector.html#matching-attrs
Stefan
More information about the lxml-dev
mailing list