Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_property #134

Merged
merged 1 commit into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/reference/session.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
:param str name: Name of the attribute to get.
:rtype: str

.. py:method:: get_property(name)

Coroutine which returns the value of a given property of this element.

:param str name: Name of the property to get.
:rtype: str

.. py:method:: select_by_value(value)

Coroutine to select an option by value. This is useful if this element is a select
Expand Down
3 changes: 3 additions & 0 deletions src/arsenic/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ async def is_enabled(self) -> bool:
async def get_attribute(self, name: str) -> str:
return await self._request(url=f"/attribute/{name}", method="GET")

async def get_property(self, name: str) -> str:
return await self._request(url=f"/property/{name}", method="GET")

async def get_css_value(self, name: str) -> str:
return await self._request(url=f"/css/{name}", method="GET")

Expand Down