#!/usr/bin/env python3

# import
import requests
from bs4 import BeautifulSoup
from color import Color

def fetcher():
    try:
        # request the page
        response = requests.get("https://en.wikipedia.org/wiki/Black_Widow_(2021_film)")

        # return the page text
        return response

    except Exception:
        raise


def parser(page):
    try:
        # soup object
        soup = BeautifulSoup(page.text, "html.parser")

        # define the selector
        selector = "h1.firstHeading > i"

        # select
        filmName = soup.select(selector)[0].text

        # output
        print(f"The name of the film is: {Color.cyan}{filmName}{Color.reset}")

        return

    except Exception:
        raise


def main():
    # fetch the page
    page = fetcher()

    # parse the page
    parser(page)


if __name__ == "__main__":
    main()

#!/usr/bin/env python3

# import
import requests
from bs4 import BeautifulSoup
from color import Color

def fetcher():
    try:
        # request the page
        response = requests.get("https://en.wikipedia.org/wiki/Black_Widow_(2021_film)")

        # return the page text
        return response

    except Exception:
        raise


def parser(page):
    try:
        # soup object
        soup = BeautifulSoup(page.text, "html.parser")

        # define the selector
        selector = "h1.firstHeading > i"

        # select
        filmName = soup.select(selector)[0].text

        # output
        print(f"The name of the film is: {Color.cyan}{filmName}{Color.reset}")

        return

    except Exception:
        raise


def main():
    # fetch the page
    page = fetcher()

    # parse the page
    parser(page)


if __name__ == "__main__":
    main()

#!/usr/bin/env python3 # import # request the page # return the page text # soup object # define the selector # select # output # fetch the page # parse the page