Avito Scraper is a Python tool for scraping listings data from Avito, a popular online marketplace. It allows users to extract information about cars, apartments, houses, and villas for sale in Morocco.
-
Scrapes car listings data from Avito website.
-
Supports specifying the number of pages to scrape.
-
Provides customizable output filename for storing scraped data.
-
Handles pagination automatically to scrape multiple pages.
-
Add ability to scrape more details in each item details page.
-
Implement scraping functionality for apartments, houses, and villas.
-
Enhance error handling and logging for better user feedback.
-
Improve configuration options for customization.
- Python
- BeautifulSoup: Python library for web scraping
- requests: Python library for making HTTP requests
- pandas: Python library for data manipulation and analysis
-
Clone the repository:
git clone https://github.com/yassinbenmansour/avito-scraper.git
-
Navigate to the Project Directory:
cd avito-scraper
-
Create and Activate a Virtual Environment (Optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use 'venv\Scripts\activate'
-
Install dependencies:
for win :
pip install -r requirements.txt
for Mac os :
pip3 install -r requirements.txt
-
Run the script:
python main.py
Run the main.py
script and follow the prompts to specify the Avito URL, the number of pages to scrape, and the output filename. The scraped data will be exported to a CSV file.
python main.py
Contributions are welcome! Please submit bug reports, feature requests, or pull requests to help improve this tool.
This project is licensed under the MIT License - see the LICENSE file for details.