Render JavaScript-rendered page as HTML using headless Chrome
Project description
# prerender
Render JavaScript-rendered page as HTML using headless Chrome
## Install Chrome Headless
Chrome Headless broweser can be easily installed using Docker:
`bash $ docker pull yukinying/chrome-headless `
## Start Chrome Headless
`bash $ docker run -i -t --shm-size=256m --rm --name=chrome-headless -p=127.0.0.1:9222:9222 yukinying/chrome-headless "about:blank" `
Or you can download a Headless Chrome binary for Ubuntu 16.04 from GitHub release and run it:
`bash $ wget https://github.com/bosondata/prerender/releases/download/v0.3.0/ChromeHeadless.ubuntu-16.04-x86_64.tar.gz $ tar zxvf ChromeHeadless.ubuntu-16.04-x86_64.tar.gz $ cd ChromeHeadless $ ./headless_shell --remote-debugging-port=9222 --disable-gpu "about:blank" `
## Install Prerender
`bash $ pip install -U prerender `
## Start Prerender
As standalone application:
`bash $ prerender `
To run it under gunicorn, first install some dependencies:
`bash $ pip install sanic-gunicorn `
Then:
`bash $ gunicorn --bind 0.0.0.0:3000 --worker-class sanic_gunicorn.Worker prerender.app:app `
## Configure client
Please view the original NodeJs version [prerender](https://github.com/prerender/prerender#official-middleware) README.
## License
MIT
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
Built Distribution
File details
Details for the file prerender-0.3.7.tar.gz
.
File metadata
- Download URL: prerender-0.3.7.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82889de6a4ce3ab2cc800c098c3b8cec69eb8d1582af002b94c69f47324a0034 |
|
MD5 | e29a729013a258e08b41858a133d28ce |
|
BLAKE2b-256 | d786f97992934825627e317172b8d6e928ad7ca1d9bcfce0d5391ade9220edf9 |
File details
Details for the file prerender-0.3.7-py3-none-any.whl
.
File metadata
- Download URL: prerender-0.3.7-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7b00fd337fccad26a64e19727e24e85662d4cb66506ba735ac9ca90248abad5 |
|
MD5 | 765d9dc11240e93997df9dd7702135bb |
|
BLAKE2b-256 | 913d893fcf5f2ee588c260bd697cdf003e6793ebcc04374404b01ae5efcaf89a |