Italy Visa Appointment Bot
Automate the process of booking an Italy visa appointment using Selenium WebDriver in Python. This project handles login, form filling, consent agreement, OTP entry, image upload, appointment slot sel
About the Project
Automate the process of booking an Italy visa appointment using Selenium WebDriver in Python. This project handles login, form filling, consent agreement, OTP entry, image upload, appointment slot selection, and retries in case of failures such as CAPTCHAs or pending appointments.
Features
- Automated login to Italy visa appointment portal.
- Fill and submit appointment form using user data from Excel.
- Handle CAPTCHA challenges with manual or automated solving.
- CAPTCHA failsafe with retry logic and password re-entry on failure.
- Detect and handle appointment pending status gracefully.
- Agree to terms via modal interactions with retries.
- Manual OTP input prompt and automated OTP form filling.
- Upload required photo with modal confirmation handling.
- Select appointment date and available time slot.
- Retry mechanism for form submission failures or alerts.
- Detailed console logging for every step.
- Graceful handling of unexpected alerts and errors.
Prerequisites
- Python 3.7+
- Google Chrome browser (or modify for other browsers)
- ChromeDriver compatible with your Chrome version (in PATH or specify path)
- Teserract: https://github.com/tesseract-ocr/tesseract/releases/download/5.5.0/tesseract-ocr-w64-setup-5.5.0.20241111.exe
- Required Python packages:
pip install selenium openpyxl
data.xlsxfile with user data in the root directory.image.jpgfile (photo to upload) in the root directory.
Project Structure
bot.pyâ Main automation script.data.xlsxâ Excel file with user data like email and password.image.jpgâ Photo file to upload during appointment.- Additional helper modules/functions as needed (e.g., for CAPTCHA handling).
Usage
-
Prepare your data Fill in your credentials and appointment details inside
data.xlsx. -
Place your photo Add the required image file named
image.jpgin the project directory. -
Run the script
python bot.py
-
Manual OTP Input When prompted, enter the OTP sent to your email.
-
Follow console logs The script will print status updates, errors, and prompts.
-
Completion After successful booking or failures, the script waits for you to press Enter before closing the browser.
Important Notes
-
OTP Handling Currently requires manual OTP entry. Automating OTP retrieval can be integrated as an enhancement.
-
CAPTCHA The script uses
solve_captcha_failsafe()which attempts to solve CAPTCHA multiple times and checks if it succeeded. If the CAPTCHA fails and the password field is still visible, it will re-enter the password and retry solving. You can extend this to integrate an external CAPTCHA solver like 2Captcha. -
Retries The script retries submission when failures occur, but you may want to set max retry limits depending on your use case.
-
Browser Driver Ensure ChromeDriver is installed and matches your Chrome browser version. Adjust
setup_driver()function if you use other browsers.
Example User Data (data.xlsx)
| email | password | other_fields... | | ------------------------------------------- | ----------- | ---------------- | | user@example.com | yourPass123 | ... |
How It Works (Summary)
- Login with user credentials.
- Fill appointment form with user data.
- Submit form and select appointment slot.
- Handle consent modal or appointment pending page.
- Input OTP manually and complete form filling.
- Upload photo with modal confirmation.
- Retry on errors like CAPTCHA, alerts, or "Try Again" prompts.
- Log each stepâs success or failure in console.
Troubleshooting
- If elements are not found, check if the website layout has changed.
- Make sure your ChromeDriver and browser versions are compatible.
- If CAPTCHA solving fails, you might need to handle it manually or update solver logic.
- Ensure your internet connection is stable during the automation.
- Review console logs for detailed error messages.
License
This project is provided as-is without any warranty. Use it responsibly and comply with the Italy visa appointment siteâs terms of service.
Project Timeline
Technologies
External Links
Related Projects
Projects built with similar technologies.
Online Html Editor And Viewer
The Online HTML Editor and Viewer is a simple web application built with Flask that allows users to write and preview HTML code in real-time.
Qrgen
A premium, feature-rich QR Code Generator engineered with Python (Flask) and a pristine Glassmorphism frontend.
Examina Ai
Using AI, It transforms raw study materials into structured, verified examination sets with support for institutional export formats like Moodle XML.