# Classes 
from website import Website
from webcrawler import Webcrawler     # To scrape/crawl websites
from cmd_args import init_cmd_args    # For initializing the commandline arguments

# Import global commandline arguments
import cmd_args

## DRIVER CODE ##
def main():
    # Initialize the commandline arguments (url, mode, timeout) as global variables
    # Identifiers: INITIAL_URL, TIMEOUT, MODE
    init_cmd_args()

    print("\nStats\n=====")
    print(f"Mode: {cmd_args.MODE}")
    print(f"Timeout: {cmd_args.TIMEOUT}")
    print(f"Initial URL: {cmd_args.INITIAL_URL}")

    # Create the initial website and web crawler
    website = Website(cmd_args.INITIAL_URL, initial_link=True)  
    webcrawler = Webcrawler()

    # Scrape the given website for links
    webcrawler.scrape_for_links(website)

    # Validate those links
    webcrawler.validate_links(website.links)

    # Print all the found links (format: 'status_code, text, url')
    webcrawler.print_links()

## Driver Code ##
if __name__ == '__main__':
    main()

# Classes 
from website import Website
from webcrawler import Webcrawler     # To scrape/crawl websites
from cmd_args import init_cmd_args    # For initializing the commandline arguments

# Import global commandline arguments
import cmd_args

## DRIVER CODE ##
def main():
    # Initialize the commandline arguments (url, mode, timeout) as global variables
    # Identifiers: INITIAL_URL, TIMEOUT, MODE
    init_cmd_args()

    print("\nStats\n=====")
    print(f"Mode: {cmd_args.MODE}")
    print(f"Timeout: {cmd_args.TIMEOUT}")
    print(f"Initial URL: {cmd_args.INITIAL_URL}")

    # Create the initial website and web crawler
    website = Website(cmd_args.INITIAL_URL, initial_link=True)  
    webcrawler = Webcrawler()

    # Scrape the given website for links
    webcrawler.scrape_for_links(website)

    # Validate those links
    webcrawler.validate_links(website.links)

    # Print all the found links (format: 'status_code, text, url')
    webcrawler.print_links()

## Driver Code ##
if __name__ == '__main__':
    main()

# Classes # To scrape/crawl websites # For initializing the commandline arguments # Import global commandline arguments ## DRIVER CODE ## # Initialize the commandline arguments (url, mode, timeout) as global variables # Identifiers: INITIAL_URL, TIMEOUT, MODE # Create the initial website and web crawler # Scrape the given website for links # Validate those links # Print all the found links (format: 'status_code, text, url') ## Driver Code ##