How to use the arsenic.constants.SelectorType function in arsenic

To help you get started, we’ve selected a few arsenic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HDE / arsenic / tests / test_real_browsers.py View on Github external
        (SelectorType.tag_name, "h2", "Title Here"),
        (SelectorType.xpath, ".//h2", "Title Here"),
    ],
)
async def test_selector_types(session, using, selector, result):
    await session.get("/selectors/")
    element = await session.wait_for_element(5, selector, using)
    assert result == await element.get_text()
github HDE / arsenic / tests / test_real_browsers.py View on Github external
        (SelectorType.css_selector, ".classname", "Class Name"),
        (SelectorType.link_text, "link text", "link text"),
        (SelectorType.partial_link_text, "partial", "partial link text"),
        (SelectorType.tag_name, "h2", "Title Here"),
        (SelectorType.xpath, ".//h2", "Title Here"),
    ],
)
async def test_selector_types(session, using, selector, result):
    await session.get("/selectors/")
    element = await session.wait_for_element(5, selector, using)
    assert result == await element.get_text()
github HDE / arsenic / src / arsenic / session.py View on Github external
async def get_elements(
        self, selector: str, selector_type: SelectorType = SelectorType.css_selector
    ) -> List["Element"]:
        element_ids = await self._request(
            url="/elements",
            method="POST",
            data={"using": selector_type.value, "value": selector},
        )
        return [self.session.create_element(element_id) for element_id in element_ids]
github HDE / arsenic / src / arsenic / session.py View on Github external
async def get_element(
        self, selector: str, selector_type: SelectorType = SelectorType.css_selector
    ) -> "Element":
        element_id = await self._request(
            url="/element",
            method="POST",
            data={"using": selector_type.value, "value": selector},
        )
        return self.session.create_element(element_id)