File size: 995 Bytes
5221213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# setup_scraping.py
import subprocess
import sys

def setup_selenium_driver():
    """Install Chrome driver for Selenium"""
    try:
        from webdriver_manager.chrome import ChromeDriverManager
        from selenium import webdriver
        from selenium.webdriver.chrome.service import Service
        
        # This will download the driver if needed
        service = Service(ChromeDriverManager().install())
        print("Chrome driver installed successfully!")
    except Exception as e:
        print(f"Error setting up Chrome driver: {e}")
        print("You may need to install Chrome/Chromium browser")

def main():
    print("Setting up scraping environment...")
    
    # Install requirements
    subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'selenium', 'webdriver-manager'])
    
    # Setup driver
    setup_selenium_driver()
    
    print("Setup complete! You can now run the scraper.")

if __name__ == "__main__":
    main()