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

Method xpath_checked_pseudo

pyquery/cssselectpatch.py:105–116  ·  view source on GitHub ↗

Matches odd elements, zero-indexed:: >>> from pyquery import PyQuery >>> d = PyQuery(' ') >>> d('input:checked') [ ] ..

(self, xpath)

Source from the content-addressed store, hash-verified

103 return xpath
104
105 def xpath_checked_pseudo(self, xpath):
106 """Matches odd elements, zero-indexed::
107
108 >>> from pyquery import PyQuery
109 >>> d = PyQuery('<div><input checked="checked"/></div>')
110 >>> d('input:checked')
111 [<input>]
112
113 ..
114 """
115 xpath.add_condition("@checked and name(.) = 'input'")
116 return xpath
117
118 def xpath_selected_pseudo(self, xpath):
119 """Matches all elements that are selected::

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected