Pyppeteer Components for Scrapy & Gerapy
Project description
Gerapy Pyppeteer
This is a package for supporting pyppeteer in Scrapy, also this package is a module in Gerapy.
Installation
pip3 install gerapy-pyppeteer
Usage
You can use PyppeteerRequest
to specify a request which uses pyppeteer to render.
For example:
yield PyppeteerRequest(detail_url, callback=self.parse_detail)
And you also need to enable PyppeteerMiddleware
in DOWNLOADER_MIDDLEWARES
:
DOWNLOADER_MIDDLEWARES = {
'gerapy_pyppeteer.downloadermiddlewares.py.PyppeteerMiddleware': 543,
}
Others optional settings:
# pyppeteer logging level
GERAPY_PYPPETEER_LOGGING_LEVEL = logging.WARNING
# pyppeteer timeout
GERAPY_PYPPETEER_DOWNLOAD_TIMEOUT = 30
# pyppeteer browser window
GERAPY_PYPPETEER_WINDOW_WIDTH = 1400
GERAPY_PYPPETEER_WINDOW_HEIGHT = 700
# pyppeteer settings
GERAPY_PYPPETEER_HEADLESS = True
GERAPY_PYPPETEER_DUMPIO = False
GERAPY_PYPPETEER_DEVTOOLS = False
GERAPY_PYPPETEER_EXECUTABLE_PATH = None
GERAPY_PYPPETEER_DISABLE_EXTENSIONS = True
GERAPY_PYPPETEER_HIDE_SCROLLBARS = True
GERAPY_PYPPETEER_MUTE_AUDIO = True
GERAPY_PYPPETEER_NO_SANDBOX = True
GERAPY_PYPPETEER_DISABLE_SETUID_SANDBOX = True
GERAPY_PYPPETEER_DISABLE_GPU = True
Example
For more detail, please see example.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gerapy-pyppeteer-0.0.2.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for gerapy_pyppeteer-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d7ad9aeac57fed70874654643759bf38ce0397f2a12661746545c953f3ffd6d |
|
MD5 | 449c7ded5d9d77278fb3a5c279d50abf |
|
BLAKE2b-256 | 49e3ee5b78db7598adf9e98cf8831dfc61a826eed8deb660a2d6c1f5957fc0bd |