Create a target after one ahs been created by the browser.
-diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 084f5db2..db8baaea 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,4 @@ +- Remove site directory - Improve error messaging - Organize functions internally - Improve choreo_diagnose diff --git a/site/404.html b/site/404.html deleted file mode 100644 index fa87cf89..00000000 --- a/site/404.html +++ /dev/null @@ -1,790 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - --choreographer.browser_async -
-browser_asyncProvides the async api: Browser, Tab.
class Tab(choreographer.protocol.devtools_async.Target):A wrapper for Target, so user can use Tab, not Target.
target_id - The browser's ID of the target.sessions - A list of all the sessions for this target.__init__(self, target_id, broker)Create a target after one ahs been created by the browser.
-arguments
-broker - - a reference to the browser's broker
-target_id - - the id given by the browser
-get_session(self)Retrieve the first session of the target, if it exists.
-send_command(self, command, params)Send a command to the first session in a target.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
-create_session(self)Create a new session on this target.
-close_session(self, session_id)Close a session by session_id.
-arguments
-session_id - - the session to close
-subscribe(self, string, callback, repeating)Subscribe to an event on the main session of this target.
-arguments
-string - - the name of the event. Can use * wildcard at the end.
-callback - - the callback (which takes a message dict and returns nothing)
-repeating - - default True, should the callback execute more than once
-unsubscribe(self, string)Remove a subscription.
-arguments
-string - - the subscription to remove.
-subscribe_once(self, string)Return a future for a browser event for the first session of this target.
-Generally python asyncio doesn't recommend futures.
-But in this case, one must call subscribe_once and await it later, -generally because they must subscribe and then provoke the event.
-arguments
-string - - the event to subscribe to
-returns
-A future to be awaited later, the complete event.
-close(self)Close the tab.
-class Browser(choreographer.protocol.devtools_async.Target):Browser is the async implementation of Browser.
target_id - The browser's ID of the target.sessions - A list of all the sessions for this target.tabs - A mapping by target_id of all the targets which are open tabs.targets - A mapping by target_id of ALL the targets.__init__(self, path, browser_cls, channel_cls, kwargs)Construct a new browser instance.
-arguments
-path - - The path to the browser executable.
-browser_cls
- - The type of browser (default: Chromium).
channel_cls
- - The type of channel to browser (default: Pipe).
kwargs - - The arguments that the browser_cls takes. For example, -headless=True/False, enable_gpu=True/False, etc.
-get_session(self)Retrieve the first session of the target, if it exists.
-send_command(self, command, params)Send a command to the first session in a target.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
-close_session(self, session_id)Close a session by session_id.
-arguments
-session_id - - the session to close
-subscribe(self, string, callback, repeating)Subscribe to an event on the main session of this target.
-arguments
-string - - the name of the event. Can use * wildcard at the end.
-callback - - the callback (which takes a message dict and returns nothing)
-repeating - - default True, should the callback execute more than once
-unsubscribe(self, string)Remove a subscription.
-arguments
-string - - the subscription to remove.
-subscribe_once(self, string)Return a future for a browser event for the first session of this target.
-Generally python asyncio doesn't recommend futures.
-But in this case, one must call subscribe_once and await it later, -generally because they must subscribe and then provoke the event.
-arguments
-string - - the event to subscribe to
-returns
-A future to be awaited later, the complete event.
-open(self)Open the browser.
-close(self)Close the browser.
-get_tab(self)Get the first tab if there is one. Useful for default tabs.
-returns
-A tab object.
-populate_targets(self)Solicit the actual browser for all targets to add to the browser object.
-create_session(self)Create a browser session. Only in supported browsers, is experimental.
-returns
-A session object.
-create_tab(self, url, width, height, window)Create a new tab.
-arguments
-url - - the url to navigate to, default ""
-width - - the width of the tab (headless only)
-height - - the height of the tab (headless only)
-window - - default False, if true, create new window, not tab
-returns
-a tab.
-close_tab(self, target_id)Close a tab by its id.
-arguments
-target_id - - the targetId of the tab to close.
--choreographer.browser_sync -
-browser_syncProvides the sync api: BrowserSync, TabSync.
class TabSync(choreographer.protocol.devtools_sync.TargetSync):A wrapper for TargetSync, so user can use TabSync, not TargetSync.
target_id - The browser's ID of the target.sessions - A list of all the sessions for this target.__init__(self, target_id, broker)Create a target after one ahs been created by the browser.
-arguments
-broker - - a reference to the browser's broker
-target_id - - the id given by the browser
-get_session(self)Retrieve the first session of the target, if it exists.
-send_command(self, command, params)Send a command to the first session in a target.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
-class BrowserSync(choreographer.protocol.devtools_sync.TargetSync):BrowserSync is the sync implementation of Browser.
target_id - The browser's ID of the target.sessions - A list of all the sessions for this target.tabs - A mapping by target_id of all the targets which are open tabs.targets - A mapping by target_id of ALL the targets.__init__(self, path, browser_cls, channel_cls, kwargs)Construct a new browser instance.
-arguments
-path - - The path to the browser executable.
-browser_cls
- - The type of browser (default: Chromium).
channel_cls
- - The type of channel to browser (default: Pipe).
kwargs - - The arguments that the browser_cls takes. For example, -headless=True/False, enable_gpu=True/False, etc.
-get_session(self)Retrieve the first session of the target, if it exists.
-send_command(self, command, params)Send a command to the first session in a target.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
-open(self)Open the browser.
-close(self)Close the browser.
-get_tab(self)Get the first tab if there is one. Useful for default tabs.
-start_output_thread(self, kwargs)Start a separate thread that dumps all messages received to stdout.
-arguments
-kwargs - - passed directly to print().
--choreographer.browsers.chromium -
-chromiumProvides a class proving tools for running chromium browsers.
-class ChromeNotFoundError(RuntimeError):Raise when browser path can't be determined.
-class Chromium():Chromium represents an implementation of the chromium browser.
-It also includes chromium-like browsers (chrome, edge, and brave).
-path - The path to the chromium executable.gpu_enabled - True if we should use the gpu. False by default for compatibility.headless - True if we should not show the browser, true by default.sandbox_enabled - True to enable the sandbox. False by default.skip_local - True if we want to avoid looking for our local download when searching path.tmp_dir - A reference to a temporary directory object the chromium needs to store data.__init__(self, channel, path, kwargs)Construct a chromium browser implementation.
-arguments
-channel
- - the choreographer.Channel we'll be using (WebSockets? Pipe?)
path - - path to the browser
-kwargs - -
-gpu_enabled (default False) - - Turn on GPU? Doesn't work in all envs.
-headless (default True) - - Actually launch a browser?
-sandbox_enabled (default False) - - Enable sandbox- -a persnickety thing depending on environment, OS, user, etc
-tmp_dir (default None) - - Manually set the temporary directory
-raises
-RuntimeError - - Too many kwargs, or browser not found.
-NotImplementedError - - Pipe is the only channel type it'll accept right now.
-logger_parser(cls, record, _old)Parse (via logging.Filter.parse()) data from browser stderr for logging.
arguments
-record
- - the logging.LogRecord object to read/modify
_old - - data that was already stripped out.
-get_popen_args(self)Return the args needed to runc chromium with subprocess.Popen().
get_cli(self)Return the CLI command for chromium.
-get_env(self)Return the env needed for chromium.
-clean(self)Clean up any leftovers form browser, like tmp files.
--choreographer.browsers -
-browsersContains implementations of browsers that choreographer can open.
-class BrowserClosedError(RuntimeError):An error for when the browser is closed accidently (during access).
-class BrowserFailedError(RuntimeError):An error for when the browser fails to launch.
-class ChromeNotFoundError(RuntimeError):Raise when browser path can't be determined.
-class Chromium():Chromium represents an implementation of the chromium browser.
-It also includes chromium-like browsers (chrome, edge, and brave).
-path - The path to the chromium executable.gpu_enabled - True if we should use the gpu. False by default for compatibility.headless - True if we should not show the browser, true by default.sandbox_enabled - True to enable the sandbox. False by default.skip_local - True if we want to avoid looking for our local download when searching path.tmp_dir - A reference to a temporary directory object the chromium needs to store data.__init__(self, channel, path, kwargs)Construct a chromium browser implementation.
-arguments
-channel
- - the choreographer.Channel we'll be using (WebSockets? Pipe?)
path - - path to the browser
-kwargs - -
-gpu_enabled (default False) - - Turn on GPU? Doesn't work in all envs.
-headless (default True) - - Actually launch a browser?
-sandbox_enabled (default False) - - Enable sandbox- -a persnickety thing depending on environment, OS, user, etc
-tmp_dir (default None) - - Manually set the temporary directory
-raises
-RuntimeError - - Too many kwargs, or browser not found.
-NotImplementedError - - Pipe is the only channel type it'll accept right now.
-logger_parser(cls, record, _old)Parse (via logging.Filter.parse()) data from browser stderr for logging.
arguments
-record
- - the logging.LogRecord object to read/modify
_old - - data that was already stripped out.
-get_popen_args(self)Return the args needed to runc chromium with subprocess.Popen().
get_cli(self)Return the CLI command for chromium.
-get_env(self)Return the env needed for chromium.
-clean(self)Clean up any leftovers form browser, like tmp files.
--choreographer.channels.pipe -
-pipeProvides a channel based on operating system file pipes.
-class Pipe():Defines an operating system pipe.
-from_external_to_choreo - Consumers need this, it is the channel the browser uses to talk to choreo.from_choreo_to_external - Consumers needs this, it is the channel choreo writes to the browser on.shutdown_lock - Once this is locked, the pipe is closed and can't be reopened.__init__(self)Construct a pipe using os functions.
-write_json(self, obj)Send one json down the pipe.
-arguments
-obj - - any python object that serializes to json.
-read_jsons(self, blocking)Read from the pipe and return one or more jsons in a list.
-arguments
-blocking - - The read option can be set to block or not.
-returns
-A list of jsons.
-close(self)Close the pipe.
--choreographer.channels -
-channelsChannels are classes that choreo and the browser use to communicate.
-This is a low-level part of the API.
-class BlockWarning(UserWarning):A warning for when block modification operatins used on incompatible OS.
-class ChannelClosedError(IOError):An error to throw when the channel has closed from either end or error.
-class JSONError(RuntimeError):Another JSONError.
-class Pipe():Defines an operating system pipe.
-from_external_to_choreo - Consumers need this, it is the channel the browser uses to talk to choreo.from_choreo_to_external - Consumers needs this, it is the channel choreo writes to the browser on.shutdown_lock - Once this is locked, the pipe is closed and can't be reopened.__init__(self)Construct a pipe using os functions.
-write_json(self, obj)Send one json down the pipe.
-arguments
-obj - - any python object that serializes to json.
-read_jsons(self, blocking)Read from the pipe and return one or more jsons in a list.
-arguments
-blocking - - The read option can be set to block or not.
-returns
-A list of jsons.
-close(self)Close the pipe.
--choreographer.cli -
-clicli provides some tools that are used on the commandline (and to download chrome).
-get_chrome(arch, i, path, verbose)Download google chrome from google-chrome-for-testing server.
-arguments
-arch - - the target platform/os, as understood by google's json directory.
-i - - the chrome version: -1 being the latest version, 0 being the oldest -still in the testing directory.
-path - - where to download it too (the folder).
-verbose - - print out version found
-get_chrome_sync(arch, i, path, verbose)Download chrome synchronously: see get_chrome().
-choreographer.errors -
-errorsA compilation of the errors available in choreographer.
-class UnhandledMessageWarning(UserWarning):class BrowserClosedError(RuntimeError):An error for when the browser is closed accidently (during access).
-class BrowserFailedError(RuntimeError):An error for when the browser fails to launch.
-class ChromeNotFoundError(RuntimeError):Raise when browser path can't be determined.
-class BlockWarning(UserWarning):A warning for when block modification operatins used on incompatible OS.
-class ChannelClosedError(IOError):An error to throw when the channel has closed from either end or error.
-class DevtoolsProtocolError(Exception):Raise a general error reported by the devtools protocol.
-code - Not documented.message - Not documented.__init__(self, response)Construct a new DevtoolsProtocolError.
-arguments
-response - - the json response that contains the error
-class ExperimentalFeatureWarning(UserWarning):An warning to report that a feature may or may not work.
-class MessageTypeError(TypeError):An error for poorly formatted devtools protocol message.
-__init__(self, key, value, expected_type)Construct a message about a poorly formed protocol message.
-arguments
-key - - the key that has the badly typed value
-value - - the type of the value that is incorrect
-expected_type - - the type that was expected
-class MissingKeyError(ValueError):An error for poorly formatted devtools protocol message.
-__init__(self, key, obj)Construct a MissingKeyError specifying which key was missing.
-arguments
-key - - the missing key
-obj - - the message without the key
-class TmpDirWarning(UserWarning):A warning if for whatever reason we can't eliminate the tmp dir.
--choreographer.protocol.devtools_async -
-devtools_asyncProvide a lower-level async interface to the Devtools Protocol.
-class Session():A session is a single conversation with a single target.
-session_id - The id of the session given by the browser.message_id - All messages are counted per session and this is the current message id.subscriptions - Not documented.__init__(self, session_id, broker)Construct a session from the browser as an object.
-A session is like an open conversation with a target. -All commands are sent on sessions.
-arguments
-broker - - a reference to the browser's broker
-session_id - - the id given by the browser
-send_command(self, command, params)Send a devtools command on the session.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
-returns
-A message key (session, message id) tuple or None
-subscribe(self, string, callback, repeating)Subscribe to an event on this session.
-arguments
-string - - the name of the event. Can use * wildcard at the end.
-callback - - the callback (which takes a message dict and returns nothing)
-repeating - - default True, should the callback execute more than once
-unsubscribe(self, string)Remove a subscription.
-arguments
-string - - the subscription to remove.
-subscribe_once(self, string)Return a future for a browser event.
-Generally python asyncio doesn't recommend futures.
-But in this case, one must call subscribe_once and await it later, -generally because they must subscribe and then provoke the event.
-arguments
-string - - the event to subscribe to
-returns
-A future to be awaited later, the complete event.
-class Target():A target like a browser, tab, or others. It sends commands. It has sessions.
-target_id - The browser's ID of the target.sessions - A list of all the sessions for this target.__init__(self, target_id, broker)Create a target after one ahs been created by the browser.
-arguments
-broker - - a reference to the browser's broker
-target_id - - the id given by the browser
-get_session(self)Retrieve the first session of the target, if it exists.
-send_command(self, command, params)Send a command to the first session in a target.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
-create_session(self)Create a new session on this target.
-close_session(self, session_id)Close a session by session_id.
-arguments
-session_id - - the session to close
-subscribe(self, string, callback, repeating)Subscribe to an event on the main session of this target.
-arguments
-string - - the name of the event. Can use * wildcard at the end.
-callback - - the callback (which takes a message dict and returns nothing)
-repeating - - default True, should the callback execute more than once
-unsubscribe(self, string)Remove a subscription.
-arguments
-string - - the subscription to remove.
-subscribe_once(self, string)Return a future for a browser event for the first session of this target.
-Generally python asyncio doesn't recommend futures.
-But in this case, one must call subscribe_once and await it later, -generally because they must subscribe and then provoke the event.
-arguments
-string - - the event to subscribe to
-returns
-A future to be awaited later, the complete event.
--choreographer.protocol.devtools_sync -
-devtools_syncProvide a lower-level sync interface to the Devtools Protocol.
-class SessionSync():A session is a single conversation with a single target.
-session_id - The id of the session given by the browser.message_id - All messages are counted per session and this is the current message id.__init__(self, session_id, broker)Construct a session from the browser as an object.
-A session is like an open conversation with a target. -All commands are sent on sessions.
-arguments
-broker - - a reference to the browser's broker
-session_id - - the id given by the browser
-send_command(self, command, params)Send a devtools command on the session.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
-returns
-A message key (session, message id) tuple or None
-class TargetSync():A target like a browser, tab, or others. It sends commands. It has sessions.
-target_id - The browser's ID of the target.sessions - A list of all the sessions for this target.__init__(self, target_id, broker)Create a target after one ahs been created by the browser.
-arguments
-broker - - a reference to the browser's broker
-target_id - - the id given by the browser
-get_session(self)Retrieve the first session of the target, if it exists.
-send_command(self, command, params)Send a command to the first session in a target.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
--choreographer.protocol -
-protocolProvides various implementations of Session and Target.
-It includes helpers and constants for the Chrome Devtools Protocol.
-BrowserResponse - The type for a response from the browser. Is really a dict().BrowserCommand - The type for a command to the browser. Is really a dict().MessageKey - The type for id'ing a message/response. It is tuple(session_id, message_id).verify_params(obj)Verify the message obj hast he proper keys and values.
-arguments
-obj - - the object to check.
-Raises
-MissingKeyError -- if a key is missing.
-MessageTypeError -- if a value type is incorrect.
-RuntimeError -- if there are strange keys.
-calculate_message_key(msg)Given a message to/from the browser, calculate the key corresponding to the command.
-Every message is uniquely identified by its sessionId and id (counter).
-arguments
-msg - - the message for which to calculate the key.
-match_message_key(response, key)Report True if a response matches with a certain key (sessionId, id).
-arguments
-response - - the object response from the browser
-key - - the (sessionId, id) key tubple we're looking for
-is_event(response)Return true if the browser response is an event notification.
-get_target_id_from_result(response)Extract target id from a browser response.
-arguments
-response - - the browser response to extract the targetId from.
-get_session_id_from_result(response)Extract session id from a browser response.
-arguments
-response - - the browser response to extract the sessionId from.
-get_error_from_result(response)Extract error from a browser response.
-arguments
-response - - the browser response to extract the error from.
-class Ecode(enum.Enum):Ecodes are a list of possible error codes chrome returns.
-TARGET_NOT_FOUND - Self explanatory.class DevtoolsProtocolError(Exception):Raise a general error reported by the devtools protocol.
-code - Not documented.message - Not documented.__init__(self, response)Construct a new DevtoolsProtocolError.
-arguments
-response - - the json response that contains the error
-class MessageTypeError(TypeError):An error for poorly formatted devtools protocol message.
-__init__(self, key, value, expected_type)Construct a message about a poorly formed protocol message.
-arguments
-key - - the key that has the badly typed value
-value - - the type of the value that is incorrect
-expected_type - - the type that was expected
-class MissingKeyError(ValueError):An error for poorly formatted devtools protocol message.
-__init__(self, key, obj)Construct a MissingKeyError specifying which key was missing.
-arguments
-key - - the missing key
-obj - - the message without the key
-class ExperimentalFeatureWarning(UserWarning):An warning to report that a feature may or may not work.
--choreographer.utils -
-utilsContains functions and class that primarily help us with the OS.
-get_browser_path(args, kwargs)Call browser_which() but check for user override first.
It looks for the browser in path.
-Accepts the same arguments as `browser_which':
-arguments
-executable_names - - the list of names to look for
-skip_local - - (default False) don't look for a choreo download of anything.
-class TmpDirectory():The python stdlib TemporaryDirectory wrapper for easier use.
Python's TemporaryDirectory suffered a couple API changes that mean
-you can't call it the same way for similar versions. This wrapper is
-also much more aggressive about deleting the directory when it's done,
-not necessarily relying on OS functions.
temp_dir - A reference to the underlying python TemporaryDirectory implementation.path - The path to the temporary directory.exists - A flag to indicate if the directory still exists.__init__(self, path, sneak)Construct a wrapped TemporaryDirectory.
arguments
-path - - manually specify the directory to use
-sneak - - (default False) avoid using /tmp -Ubuntu's snap will sandbox /tmp
-clean(self)Try several different ways to eliminate the temporary directory.
-class TmpDirWarning(UserWarning):A warning if for whatever reason we can't eliminate the tmp dir.
--choreographer -
-choreographerchoreographer is a browser controller for python.
-choreographer is natively async, so while there are two main entrypoints:
-classes Browser and BrowserSync, the sync version is very limited, functioning
-as a building block for more featureful implementations.
See the main README for a quickstart.
-class Browser(choreographer.protocol.devtools_async.Target):Browser is the async implementation of Browser.
target_id - The browser's ID of the target.sessions - A list of all the sessions for this target.tabs - A mapping by target_id of all the targets which are open tabs.targets - A mapping by target_id of ALL the targets.__init__(self, path, browser_cls, channel_cls, kwargs)Construct a new browser instance.
-arguments
-path - - The path to the browser executable.
-browser_cls
- - The type of browser (default: Chromium).
channel_cls
- - The type of channel to browser (default: Pipe).
kwargs - - The arguments that the browser_cls takes. For example, -headless=True/False, enable_gpu=True/False, etc.
-get_session(self)Retrieve the first session of the target, if it exists.
-send_command(self, command, params)Send a command to the first session in a target.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
-close_session(self, session_id)Close a session by session_id.
-arguments
-session_id - - the session to close
-subscribe(self, string, callback, repeating)Subscribe to an event on the main session of this target.
-arguments
-string - - the name of the event. Can use * wildcard at the end.
-callback - - the callback (which takes a message dict and returns nothing)
-repeating - - default True, should the callback execute more than once
-unsubscribe(self, string)Remove a subscription.
-arguments
-string - - the subscription to remove.
-subscribe_once(self, string)Return a future for a browser event for the first session of this target.
-Generally python asyncio doesn't recommend futures.
-But in this case, one must call subscribe_once and await it later, -generally because they must subscribe and then provoke the event.
-arguments
-string - - the event to subscribe to
-returns
-A future to be awaited later, the complete event.
-open(self)Open the browser.
-close(self)Close the browser.
-get_tab(self)Get the first tab if there is one. Useful for default tabs.
-returns
-A tab object.
-populate_targets(self)Solicit the actual browser for all targets to add to the browser object.
-create_session(self)Create a browser session. Only in supported browsers, is experimental.
-returns
-A session object.
-create_tab(self, url, width, height, window)Create a new tab.
-arguments
-url - - the url to navigate to, default ""
-width - - the width of the tab (headless only)
-height - - the height of the tab (headless only)
-window - - default False, if true, create new window, not tab
-returns
-a tab.
-close_tab(self, target_id)Close a tab by its id.
-arguments
-target_id - - the targetId of the tab to close.
-class Tab(choreographer.protocol.devtools_async.Target):A wrapper for Target, so user can use Tab, not Target.
target_id - The browser's ID of the target.sessions - A list of all the sessions for this target.__init__(self, target_id, broker)Create a target after one ahs been created by the browser.
-arguments
-broker - - a reference to the browser's broker
-target_id - - the id given by the browser
-get_session(self)Retrieve the first session of the target, if it exists.
-send_command(self, command, params)Send a command to the first session in a target.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
-create_session(self)Create a new session on this target.
-close_session(self, session_id)Close a session by session_id.
-arguments
-session_id - - the session to close
-subscribe(self, string, callback, repeating)Subscribe to an event on the main session of this target.
-arguments
-string - - the name of the event. Can use * wildcard at the end.
-callback - - the callback (which takes a message dict and returns nothing)
-repeating - - default True, should the callback execute more than once
-unsubscribe(self, string)Remove a subscription.
-arguments
-string - - the subscription to remove.
-subscribe_once(self, string)Return a future for a browser event for the first session of this target.
-Generally python asyncio doesn't recommend futures.
-But in this case, one must call subscribe_once and await it later, -generally because they must subscribe and then provoke the event.
-arguments
-string - - the event to subscribe to
-returns
-A future to be awaited later, the complete event.
-close(self)Close the tab.
-class BrowserSync(choreographer.protocol.devtools_sync.TargetSync):BrowserSync is the sync implementation of Browser.
target_id - The browser's ID of the target.sessions - A list of all the sessions for this target.tabs - A mapping by target_id of all the targets which are open tabs.targets - A mapping by target_id of ALL the targets.__init__(self, path, browser_cls, channel_cls, kwargs)Construct a new browser instance.
-arguments
-path - - The path to the browser executable.
-browser_cls
- - The type of browser (default: Chromium).
channel_cls
- - The type of channel to browser (default: Pipe).
kwargs - - The arguments that the browser_cls takes. For example, -headless=True/False, enable_gpu=True/False, etc.
-get_session(self)Retrieve the first session of the target, if it exists.
-send_command(self, command, params)Send a command to the first session in a target.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
-open(self)Open the browser.
-close(self)Close the browser.
-get_tab(self)Get the first tab if there is one. Useful for default tabs.
-start_output_thread(self, kwargs)Start a separate thread that dumps all messages received to stdout.
-arguments
-kwargs - - passed directly to print().
-class TabSync(choreographer.protocol.devtools_sync.TargetSync):A wrapper for TargetSync, so user can use TabSync, not TargetSync.
target_id - The browser's ID of the target.sessions - A list of all the sessions for this target.__init__(self, target_id, broker)Create a target after one ahs been created by the browser.
-arguments
-broker - - a reference to the browser's broker
-target_id - - the id given by the browser
-get_session(self)Retrieve the first session of the target, if it exists.
-send_command(self, command, params)Send a command to the first session in a target.
-https://chromedevtools.github.io/devtools-protocol/
-arguments
-command - - devtools command to send
-params - - the parameters to send
-