Skip to main content

Binary of chromium for usin in lambda functions

Project description

chromium-binary-lambda

PyPI PyPI version

Note: The project does not provide the framework to deal with chrome. But the chrome binaries so that it can be used in either AWS Lambda or Gcloud Functions.

Installation

chromium-binary-lambda requires Python >= 3.7

Install with pip from PyPI:

pip install chromium-binary-lambda

Or install the latest version from this github repo:

pip install -U git+https://github.com/chromium-binary-lambda/chromium-binary-lambda@dev

Usage

Note: When you install chromium-binary-lambda, it downloads the latest version of Chromium (~150MB) if it is not found on your system. If you don't prefer this behavior, ensure that a suitable Chrome binary is installed. One way to do this is to run pip install chromium-binary-lambda==<versionChrome> command before prior to install this library.

Examples

Open web page and take a screenshot usin Playwright:

pip install playwright
import asyncio
from chromium_binary_lambda import chromium_executable, default_args
from playwright.async_api import async_playwright

async def main():
    client = await async_playwright().start()
    browser = await client.chromium.launch(executable_path=chromium_executable(), args=default_args)
    page = await browser.new_page()
    await page.goto('https://example.com')
    await page.screenshot({'path': 'example.png'})
    await browser.close()

asyncio.get_event_loop().run_until_complete(main())

Credits

  • python setup.py sdist
  • twine upload --repository pypi ./dist/*.tar.gz
This package was created by Fabricio Silva.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chromium-binary-lambda-1.0.13.tar.gz (5.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page