forked from cobrateam/splinter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.py
More file actions
32 lines (22 loc) · 815 Bytes
/
exceptions.py
File metadata and controls
32 lines (22 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- coding: utf-8 -*-
# Copyright 2012 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
class DriverNotFoundError(Exception):
"""
Exception raised when a driver is not found.
Example:
>>> from splinter import Browser
>>> b = Browser('unknown driver') # raises DriverNotFoundError
"""
pass
class ElementDoesNotExist(Exception):
"""
Exception raised when an element is not found in the page.
The exception is raised only when someone tries to access the element,
not when the driver is finding it.
Example:
>>> elements = browser.find_by_id('unknown-id') # returns an empty list
>>> elements[0] # raises ElementDoesNotExist
"""
pass