Skip to content

psy-ger/Scraping_site_Rozetka_using_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Rozetka Scraper

This small scraper fetches product data (title, price, old price, discount, url) from a Rozetka category page and saves the results to products.json.

Usage

  1. Install dependencies:

    • requests
    • beautifulsoup4
    • lxml
    • (optional) fake-useragent

    Example: pip install requests beautifulsoup4 lxml fake-useragent

  2. Run the script: python script.py

Output

  • products.json: JSON file with structure: { "products": [ { "name": "...", "price": "...", "old_price": "...", "discount": "...", "url": "..." }, ... ] }

Notes

  • The scraper uses a User-Agent header. If fake_useragent is not available, a stable fallback is used.
  • The script includes basic error handling:
    • Network errors return an empty product list and log an error.
    • Parsing errors return an empty product list and log an error.
    • File write errors are logged.
  • To adapt selectors or classes, update the find_all calls in rozetka_scraper.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages