Desktop application for parsing and comparing drug prices from tabletka.by pharmacies. Exports results to a formatted Excel spreadsheet.
- Parse prices from multiple pharmacies in one click
- Compare prices across pharmacies with color-coded highlighting
- Multi-profile support — save different pharmacy sets and switch between them
- Export results to
.xlsxwith customizable column widths and color settings - Clean GUI built with CustomTkinter (supports light/dark/system theme)
- Python 3.13+
uvpackage manager
git clone https://github.com/RomanAndr/pharmparser.git
cd pharmparser
uv syncCopy the example config and fill in your session credentials:
cp config.json.example config.jsonconfig.json structure:
- Open tabletka.by in your browser and log in
- Open DevTools → Network tab
- Make any request to the pharmacy prices page
- Copy the
Cookieheader value and the_csrftoken from the request payload - Paste them into
config.json
You can use Postman or any HTTP client to verify the request works before running the app.
uv run main.py- Select or create a profile with your pharmacy URLs
- Click Parse — the app fetches current prices
- The result is saved as an
.xlsxfile defined infileName
pharmparser/
├── core/
│ └── parser_engine.py # HTTP requests & HTML parsing logic
├── ui/
│ ├── app.py # Main application window
│ ├── entry.py # Input fields
│ ├── profile.py # Profile management UI
│ └── profile_selector.py
├── utils/
│ ├── datatypes.py
│ ├── file_utils.py # Excel export
│ ├── filter_criteria.py
│ ├── request.py # Request builder
│ ├── settings.py # Config loader
│ ├── sort_order.py
│ └── widgets.py # Reusable UI components
├── excel/ # Excel formatting helpers
├── main.py
├── config.json.example
└── pyproject.toml| Layer | Library |
|---|---|
| GUI | CustomTkinter |
| HTTP | requests, aiohttp |
| Parsing | beautifulsoup4, lxml |
| Export | openpyxl, pandas |
| Packaging | pyinstaller |
{ "profiles": { "Profile 1": { "1": "https://tabletka.by/pharmacies/****" // pharmacy page URL } }, "settings": { "green": "19CF1F", // color for lower price "red": "E81737", // color for higher price "title": "My Report", "fileName": "data.xlsx", "colWidth": 50, "cellWidth": 15, "diffWidth": 10 }, "request": { "url": "https://tabletka.by/ajax-request/reload-pharmacy-price", "headers": { "Cookie": "PHPSESSID=...; _csrf=...; regionId=..." }, "data": { "sort": "name", "sort_type": "asc", "str": "", "_csrf": "..." } } }