arsenic.connection

arsenic.connection.WEB_ELEMENT

Constant string used to denote web elements in the web driver protocol.

class arsenic.connection.Connection(session, prefix)

Connection class to use for communication with a webdriver. This class operates with a prefix to make it easier to use internally.

Parameters:
  • session (aiohttp.client.ClientSession) – Aiohttp client session.
  • prefix (str) – Prefix for this connection.
request(*, url, method, data=None, raw=False)

Coroutine to do an HTTP request. All arguments are keyword only.

Parameters:
  • url (str) – The URL to send the request to.
  • method (str) – HTTP method to use.
  • data – Optional data to send. Must be JSON serializable.
  • raw (bool) – Optional flag to get the raw response data instead of unwrapped data.
upload_file(path):

Coroutine that uploads a file. This is used for remote webdrivers. This is used internally by arsenic.session.Element.send_file().

This method is no-op by default.

Parameters:path (pathlib.Path) – The (local) path of the file to upload.
Returns:A path indicating the remote path.
Return type:pathlib.Path
prefixed(prefix):

Returns a new connection, inheriting the HTTP session, with the extra prefix given.

Parameters:prefix (str) – Prefix to add to the current prefix.
Return type:Connection
class arsenic.connection.RemoteConnection

Connection class for remote webdrivers. Most notably, Connection.upload_file() is no longer a no-op operation.