A Python-based web scraper designed to extract perfume product data from Liliome.com, including brand information, product titles, prices, ratings, and images.
All collected data is automatically saved into a SQLite database (Perfume.db).
- Uses
requests.Sessionwith retry logic - Handles connection failures gracefully (
safe_get())
- Extracts:
- Brand name
- English title
- Persian title
- Old price
- New price
- Product rating (Point)
- Photo URL
- Automatically discovers all available brands and their product pages
- Detects number of pages for each brand using
total_pages()
Two tables are created automatically:
| Column | Type | Description |
|---|---|---|
| Brand_ID | INTEGER | Primary key |
| Brand_Link | TEXT | URL of brand page |
| Brand_Name | TEXT | Extracted brand name |
| Column | Type | Description |
|---|---|---|
| ID | INTEGER | Primary key |
| Brand | TEXT | Brand slug |
| EnglishName | TEXT | Product English title |
| Name | TEXT | Product Persian title |
| Point | INTEGER | Product rating |
| OldPrice | INTEGER | Old price |
| NewPrice | INTEGER | New price |
| Photo | TEXT | Image URL |
- Python 3
- Requests
- BeautifulSoup4
- SQLite3
- Retry & Timeout handling
- Regex for price cleanup
Perfume_Scraper/
│
├── assets/
│ └── Brands_Table.png
│ └── Master_Table.png
│
├── db/
│ └── Perfume.db # Automatically created database
│
├── Perfume_Scraper.py # Main scraper script
├── README.md
├── requirements.txt
The script visits:
https://liliome.com/برندها-عطر-ادکلن-فروشگاه-عطر-لیلیوم
It finds all brand links and stores them in the Brands table.
- Detects how many pages of products exist
- Extracts products from each page
- Saves structured data into the
Mastertable
- Clone the repository:
git clone https://github.com/SamiraSiavash/Perfume_Scraper.git
cd Perfume_Scraper
- Install dependencies:
pip install -r requirements.txt
- Run the scraper:
python Perfume_Scraper.py
Data will be saved automatically into:
perfumes.db
Inside a table such as:
Master(ID, Brand, EnglishName, Name, Point, OldPrice, NewPrice, Photo)


- Adjust CSS selectors depending on website structure.
- Website layouts may change; update selectors accordingly.
- Always follow the target website’s Terms of Service.
MIT License (optional)
Samira Siavash
🔗 GitHub: https://github.com/SamiraSiavash
🔗 LinkedIn: https://linkedin.com/in/samira-siavash