This Python script uses Selenium to scrape data from the MCI (Mobile Telecommunication Company of Iran) website to collect information about the internet coverage status for various regions in Iran. The data is then saved to an Excel file for further analysis.
These instructions will help you set up and run the web scraping script on your local machine. You can use different web browsers, not limited to Chrome, depending on your preference.
-
Python: Make sure you have Python installed on your system. You can download it from the Python official website.
-
Web Driver: You will need to download the WebDriver executable that matches your preferred web browser. Here are some common options:
- Chrome WebDriver Downloads (for Chrome)
- GeckoDriver for Firefox (for Firefox)
- WebDriver for Other Browsers (for other browsers)
-
Required Python packages: You can install the necessary Python packages using pip:
pip install selenium pandas
-
Clone the repository to your local machine.
git clone https://github.com/amasoudfam/MCI-Internet-Coverage.git
-
Move into the project directory.
cd MCI-Internet-Coverage
-
Download and place the WebDriver executable for your preferred web browser in the project directory.
-
Run the Python script.
python MCI_internet_coverage.py
-
The script will scrape the data and save it in an Excel file named
MCI_internet_coverage.xlsx
in the same directory.
Please Note: The WebDriver file (e.g., chromedriver
for Chrome) must be placed in the same directory as the Python script (MCI_internet_coverage.py
) for the script to work correctly. Make sure the WebDriver version matches your web browser.
The scraped data is saved in an Excel file with the following columns:
- Province
- Region
- Status (Internet Coverage Status)
- 3G (1 if 3G is available, 0 otherwise)
- 4G (1 if 4G is available, 0 otherwise)
- 4.5G (1 if 4.5G is available, 0 otherwise)
This project is licensed under the MIT License - see the LICENSE file for details.
- This project is not affiliated with or endorsed by MCI (Mobile Telecommunication Company of Iran).
- Web Scraping Wikipedia
- Web Scraping Using Python
- Selenium Official Documentation
- Selenium Python Tutorial
- Selenium with Python - Tutorialspoint
- Web Scraping with Selenium and Python
You can use web browsers other than Chrome with Selenium. To learn more about setting up Selenium with different browsers, refer to the official documentation:
This web scraping script is designed to work with the current design and structure of the MCI website as of October 23, 2023. Websites may undergo updates or changes in design over time, which can impact the script's functionality. If you encounter issues with the script, especially after changes to the MCI website, you may need to adapt the script to match the new structure.