Skip to main content

scrape google via playwright

Project description

google-scraper-pw

[tests]pythonCode style: blackLicense: MITPyPI version

scrape google using playwright, cross platform (Windows/MacOS/Linux)

Installation

pip install google-scraper-pw
# pip install google-scraper-pw -U  # upgrade to the latest version
python -m playwright install chromium
or via poetry poetry add google-scraper-pw && python -m playwright install chromium

or

pip install git+https://github.com/ffreemt/google-scraper-playwright.git
python -m playwright install chromium

or clone the repo (git clone https://github.com/ffreemt/google-scraper-playwright.git) and install from it and

python -m playwright install chromium

Usage

from pprint import pprint
from google_scraper_pw import google_tr

res = google_tr("test me")
print(res)
# '考验我'  # took 2.8s

# google_tr preserves format
pprint(google_tr("test you\n\n test me", to_lang="de"))
#'teste dich\n\n  teste mich'

text = "Playwright is a Python library to automate Chromium, Firefox and WebKit browsers with a single API. Playwright delivers automation that is ever-green, capable, reliable and fast. "

print(google_tr(text, to_lang="de"))

# Playwright ist eine Python-Bibliothek, um Chrom-, Firefox- und Webkit-Browser mit einer einzigen API zu automatisieren. Der Dramatiker liefert Automatisierung, die jemals grün, fähig, zuverlässig und schnell ist.  # took: 2.5s

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

google-scraper-pw-0.1.0.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

google_scraper_pw-0.1.0-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

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