Skip to main content

Mutliple we scraper using aiohttp to make it easy to scrape multiple URLs

Project description

About

Scrape main content on multiple websites using Python in parallel.

Dependency

How to use

pip install py-web-scraper

Quick usage:

import asyncio
from py_websites_scraper import scrape_urls

urls = ["https://news.ycombinator.com", "https://example.com"]
data = asyncio.run(scrape_urls(urls, max_concurrency=5))
for item in data:
    print(item["url"], item.get("title"))

You can add any parameters for aiohttp to perform the request like headers, proxy, and more.

Example:

urls = []
 results = await scrape_urls(
        urls,
        proxy="YOUR_PROXY_INFO",
        headers={"User-Agent": "USER_AGENT_INFO"},
    )

Limitation

  • Gated content
  • Dynamic generated content

How the test the package locally for Dev

Install in editable mode:

pip install -e .

Run any file that importing this package

python test_local.py

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

py_websites_scraper-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_websites_scraper-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file py_websites_scraper-0.1.0.tar.gz.

File metadata

  • Download URL: py_websites_scraper-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for py_websites_scraper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 de2c6db3ae4602994c0b1dd38365491d610c5a88b0fe4e0c0fae8592563b9ff2
MD5 727de7043822b204b5f3309f45181eb6
BLAKE2b-256 5b1a841c9179ddca62e83d1174e8603cad45315489f7caea9a8abb13695575dd

See more details on using hashes here.

File details

Details for the file py_websites_scraper-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for py_websites_scraper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c95f2e345ed5e16cc17971129f96ce07c84bf7fcd3c38928ab2a81b3229a4e1
MD5 bff833f130825f1eb641baaea89fcdb0
BLAKE2b-256 744015d847c7dd997980cdf85733c0b5c80692652d685191883f403e91547f42

See more details on using hashes here.

Supported by

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