Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frome selenium import webdriver error #216

Open
shabirhamza opened this issue Mar 13, 2025 · 0 comments
Open

frome selenium import webdriver error #216

shabirhamza opened this issue Mar 13, 2025 · 0 comments

Comments

@shabirhamza
Copy link

<from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
import time
import random

مسیر ChromeDriver را مشخص کن

CHROME_DRIVER_PATH = "chromedriver.exe" # اگر در همان پوشه است، همین بماند

تنظیمات مرورگر کروم

chrome_options = Options()
chrome_options.add_argument("--disable-blink-features=AutomationControlled")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")

راه‌اندازی مرورگر

service = Service(CHROME_DRIVER_PATH)
driver = webdriver.Chrome(service=service, options=chrome_options)

آدرس سایت ایران ویزا

url = "https://evisatraveller.mfa.ir/fa/request/applyrequest/"

while True:
try:
driver.get(url)
time.sleep(random.uniform(5, 10)) # تأخیر تصادفی

    print("✅ صفحه بررسی شد، منتظر دور بعدی...")
    time.sleep(random.uniform(30, 120))  # تأخیر بین درخواست‌ها

except Exception as e:
    print(f"⚠️ خطا رخ داد: {e}")
    time.sleep(60)

در صورت نیاز مرورگر را ببند

driver.quit()!-- Please search existing issues to avoid creating duplicates -->

@shabirhamza shabirhamza changed the title frome selenium import bebdriver frome selenium import webdriver error Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant