import requests
from bs4 import BeautifulSoup


def url2bs(url: str):
    """
    HTTP GET response text with the url to a BeautifulSoup object parsed with lxml.
    :param url: URL.
    :return: BeautifulSoup object.
    """
    try:
        response = requests.get(url)
        result = BeautifulSoup(response.text, 'lxml')
    except requests.exceptions.RequestException as e:
        print('Error in HTTP GET from the url:\n\t' + url + '\nERROR MESSAGE:')
        print(e)
        result = None

    return result