Skip to content

A switch to make selenium return None instead of raising NoSuchElementException? #3319

@eromoe

Description

@eromoe

Meta -

Selenium Version:
3.0 (python)

Browser:
phantomjs

Detail:

I am using selenium as crawler, it would be much more convenient to let

driver.find_element_by_xpath('xxxx')
driver.find_element_by_css_selector('xxx')

return None instead of raising NoSuchElementException when nothing found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions