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.
-
Required Python packages: You can install the necessary Python packages using pip:
pip install -r requirements.txt
-
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
-
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: There is no need to add executable webdriver file in the code directory in selenium v4.6.0
or above. Selenium Manager will download the webdriver automatically.
For the lower selenium versions, 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. You can download the webdriver via links below. Make sure the WebDriver version matches your web browser.
- Chrome WebDriver Downloads (for Chrome)
- GeckoDriver for Firefox (for Firefox)
- WebDriver for Other Browsers (for other browsers)
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).
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.