from bs4 import BeautifulSoup
import requests


def fetch_page(url, method, **kwargs) -> BeautifulSoup:
    """Execute request for page and return as soup"""
    ret = requests.request(method, url, **kwargs)

    if ret.status_code != 200:
        raise Exception(f"Page {url} returned {ret.status_code}")

    return BeautifulSoup(ret.text, features='lxml')