pyppeteer-install: Download and install chromium for pyppeteer.
-
$PYPPETEER_HOME: Specify the directory to be used by pyppeteer. Pyppeteer uses this directory for extracting downloaded Chromium, and for making temporary user data directory. Default location depends on platform:- Windows:
C:\Users\<username>\AppData\Local\pyppeteer - OS X:
/Users/<username>/Library/Application Support/pyppeteer - Linux:
/home/<username>/.local/share/pyppeteer- or in
$XDG_DATA_HOME/pyppeteerif$XDG_DATA_HOMEis defined.
- or in
Details see appdirs's
user_data_dir. - Windows:
-
$PYPPETEER_DOWNLOAD_HOST: Overwrite host part of URL that is used to download Chromium. Defaults tohttps://storage.googleapis.com. -
$PYPPETEER_CHROMIUM_REVISION: Specify a certain version of chromium you'd like pyppeteer to use. Default value can be checked bypyppeteer.__chromium_revision__. -
$PYPPETEER_NO_PROGRESS_BAR: Suppress showing progress bar in chromium download process. Acceptable values are1ortrue(case-insensitive).
.. currentmodule:: pyppeteer
.. autofunction:: launch .. autofunction:: connect .. autofunction:: defaultArgs .. autofunction:: executablePath
.. currentmodule:: pyppeteer.browser
.. autoclass:: pyppeteer.browser.Browser :members: :exclude-members: create
.. currentmodule:: pyppeteer.browser
.. autoclass:: pyppeteer.browser.BrowserContext :members:
.. currentmodule:: pyppeteer.page
.. autoclass:: pyppeteer.page.Page :members: :exclude-members: create
.. currentmodule:: pyppeteer.worker
.. autoclass:: pyppeteer.worker.Worker :members:
.. currentmodule:: pyppeteer.input
.. autoclass:: pyppeteer.input.Keyboard :members:
.. currentmodule:: pyppeteer.input
.. autoclass:: pyppeteer.input.Mouse :members:
.. currentmodule:: pyppeteer.tracing
.. autoclass:: pyppeteer.tracing.Tracing :members:
.. currentmodule:: pyppeteer.dialog
.. autoclass:: pyppeteer.dialog.Dialog :members:
.. currentmodule:: pyppeteer.page
.. autoclass:: pyppeteer.page.ConsoleMessage :members:
.. currentmodule:: pyppeteer.frame
.. autoclass:: pyppeteer.frame_manager.Frame :members:
.. currentmodule:: pyppeteer.execution_context
.. autoclass:: pyppeteer.execution_context.ExecutionContext :members:
.. autoclass:: pyppeteer.execution_context.JSHandle :members:
.. currentmodule:: pyppeteer.element_handle
.. autoclass:: pyppeteer.element_handle.ElementHandle :members:
.. currentmodule:: pyppeteer.network_manager
.. autoclass:: pyppeteer.network_manager.Request :members:
.. currentmodule:: pyppeteer.network_manager
.. autoclass:: pyppeteer.network_manager.Response :members:
.. currentmodule:: pyppeteer.target
.. autoclass:: pyppeteer.target.Target :members:
.. currentmodule:: pyppeteer.connection
.. autoclass:: pyppeteer.connection.CDPSession :members:
.. currentmodule:: pyppeteer.coverage
.. autoclass:: pyppeteer.coverage.Coverage :members:
For debugging, you can set logLevel option to logging.DEBUG for
:func:pyppeteer.launcher.launch and :func:pyppeteer.launcher.connect
functions. However, this option prints too many logs including SEND/RECV
messages of pyppeteer. In order to only show suppressed error messages, you
should set pyppeteer.DEBUG to True.
Example:
import asyncio
import pyppeteer
from pyppeteer import launch
pyppeteer.DEBUG = True # print suppressed errors as error log
async def main():
browser = await launch()
... # do something
asyncio.get_event_loop().run_until_complete(main())