You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mikhail Trifonov edited this page Jun 4, 2019
·
2 revisions
Simple usage
For find one element
from pagium import Page, PageElement, By
class MyPage(Page):
my_element = PageElement(by=By.NAME, value='name')
with MyPage(wd, 'http://project') as page:
print(page.my_element.text)
List of elements
For find list of elements
class MyPage(Page):
my_element_text = PageElement(by=By.NAME, value='name', is_list=True)
Web element hook
You can use hook callback for prepare result from descriptor
class MyPage(Page):
my_element_text = PageElement(by=By.NAME, value='name', hook=lambda we: we.text)