HENNGE / arsenic

Async WebDriver implementation for asyncio and asyncio-compatible frameworks
Other
350 stars 53 forks source link

add xpath selector option #58

Closed VelikiiNehochuha closed 5 years ago

ojii commented 5 years ago

Thank you for your pull request, at first glance it looks good but there's one minor change I would appreciate. Could you make the selector_type and Enum? The possible values can be found here.

VelikiiNehochuha commented 5 years ago

I've taken possible values from selenium https://selenium-python.readthedocs.io/api.html#selenium.webdriver.common.by.By, so

class SelectorType(Enum):
    CLASS_NAME = "class name"
    CSS_SELECTOR = "css selector"
    ID = "id"
    LINK_TEXT = "link text"
    NAME = "name"
    PARTIAL_LINK_TEXT = "partial link text"
    TAG_NAME = "tag name"
    XPATH = "xpath" 
ojii commented 5 years ago

@OmJan thank you for your contribution, I've moved the selector types to constants.py and lowercased all the names.

ojii commented 5 years ago

@OmJan I've also removed the non-official selector types again since they don't actually work (I assume selenium implements these client side) and are neatly covered by the css selector anyway.