MCPcopy Create free account
hub / github.com/gawel/pyquery / xpath_input_pseudo

Method xpath_input_pseudo

pyquery/cssselectpatch.py:190–204  ·  view source on GitHub ↗

Matches all input elements:: >>> from pyquery import PyQuery >>> d = PyQuery((' ' ... ' ')) >>> d(':input') [ , ] ..

(self, xpath)

Source from the content-addressed store, hash-verified

188 return xpath
189
190 def xpath_input_pseudo(self, xpath):
191 """Matches all input elements::
192
193 >>> from pyquery import PyQuery
194 >>> d = PyQuery(('<div><input type="file"/>'
195 ... '<textarea></textarea></div>'))
196 >>> d(':input')
197 [<input>, <textarea>]
198
199 ..
200 """
201 xpath.add_condition((
202 "(name(.) = 'input' or name(.) = 'select') "
203 "or (name(.) = 'textarea' or name(.) = 'button')"))
204 return xpath
205
206 def xpath_button_pseudo(self, xpath):
207 """Matches all button input elements and the button element::

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected