MCPcopy Index your code
hub / github.com/pyscript/pyscript / find

Method find

core/src/stdlib/pyscript/web.py:1445–1459  ·  view source on GitHub ↗

Find all elements matching the [CSS `selector`](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Selectors). Returns an `ElementCollection` of matching elements. ```python page.find("div") # All divs on the page page.find(".my-cl

(self, selector)

Source from the content-addressed store, hash-verified

1443 self.body.append(*items)
1444
1445 def find(self, selector):
1446 """
1447 Find all elements matching the
1448 [CSS `selector`](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Selectors).
1449
1450 Returns an `ElementCollection` of matching elements.
1451
1452 ```python
1453 page.find("div") # All divs on the page
1454 page.find(".my-class") # All elements with class
1455 page.find("#my-id") # Element with id (as collection)
1456 page.find("div.my-class") # All divs with class
1457 ```
1458 """
1459 return _find_and_wrap(document, selector)
1460
1461
1462page = Page()

Callers 15

setupFunction · 0.45
teardownFunction · 0.45
test_find_item_by_classFunction · 0.45
test_equalityMethod · 0.45
test_when_decoratorMethod · 0.45
test_text_attributeMethod · 0.45

Calls 1

_find_and_wrapFunction · 0.85

Tested by 15

setupFunction · 0.36
teardownFunction · 0.36
test_find_item_by_classFunction · 0.36
test_equalityMethod · 0.36
test_when_decoratorMethod · 0.36
test_text_attributeMethod · 0.36
test_iter_eq_childrenMethod · 0.36
test_slicesMethod · 0.36