import requests
from bs4 import BeautifulSoup


def get_soup(page_url):
    """ Returns BeautifulSoup object of the url provided """
    try:
        req = requests.get(page_url)
    except Exception:
        print('Failed to establish a connection with the website')
        return
    if req.status_code == 404:
        print('Page not found')
        return

    content = req.content
    soup = BeautifulSoup(content, 'html.parser')
    return soup