arsenic
arsenic copied to clipboard
how to receive correctly xpath ?
I'm sorry but I do not understand what you're trying to ask. Could you explain in more detail?
I think it is about xpath selector, I've done pull request for it https://github.com/HDE/arsenic/pull/58
async def test_simple_form_submit_xpath(session):
await session.get("/html/")
field = await session.wait_for_element(5, './/input[@name="field"]', "xpath")
await field.send_keys("sample input")
submit = await session.get_element('.//input[@type="submit"]', "xpath")
await submit.click()
h2 = await session.wait_for_element(5, ".//h2", "xpath")
assert "sample input" == await h2.get_text()
This would be really good since its sometimes to get the exakt CSS Selector
I think it is about xpath selector, I've done pull request for it #58
async def test_simple_form_submit_xpath(session): await session.get("/html/") field = await session.wait_for_element(5, './/input[@name="field"]', "xpath") await field.send_keys("sample input") submit = await session.get_element('.//input[@type="submit"]', "xpath") await submit.click() h2 = await session.wait_for_element(5, ".//h2", "xpath") assert "sample input" == await h2.get_text()
Hi! This doesn't work with xpath. I call: await session.wait_for_element(20, '//button[text()="Войти"]', 'xpath')
And got AttributeError:
data={"using": selector_type.value, "value": selector}, AttributeError: 'str' object has no attribute 'value'
I think it is about xpath selector, I've done pull request for it #58
async def test_simple_form_submit_xpath(session): await session.get("/html/") field = await session.wait_for_element(5, './/input[@name="field"]', "xpath") await field.send_keys("sample input") submit = await session.get_element('.//input[@type="submit"]', "xpath") await submit.click() h2 = await session.wait_for_element(5, ".//h2", "xpath") assert "sample input" == await h2.get_text()
Hi! This doesn't work with xpath. I call: await session.wait_for_element(20, '//button[text()="Войти"]', 'xpath')
And got AttributeError:
data={"using": selector_type.value, "value": selector}, AttributeError: 'str' object has no attribute 'value'
Same error
same error...
data={"using": selector_type.value, "value": selector}, AttributeError: 'str' object has no attribute 'value'
I think it is about xpath selector, I've done pull request for it #58
async def test_simple_form_submit_xpath(session): await session.get("/html/") field = await session.wait_for_element(5, './/input[@name="field"]', "xpath") await field.send_keys("sample input") submit = await session.get_element('.//input[@type="submit"]', "xpath") await submit.click() h2 = await session.wait_for_element(5, ".//h2", "xpath") assert "sample input" == await h2.get_text()
Hi! This doesn't work with xpath. I call: await session.wait_for_element(20, '//button[text()="Войти"]', 'xpath') And got AttributeError: data={"using": selector_type.value, "value": selector}, AttributeError: 'str' object has no attribute 'value'
Same error
I found the solution
from arsenic.constants import SelectorType
field = await session.wait_for_element(5, './/input[@name="field"]', SelectorType.xpath)
this worked for me