File size: 387 Bytes
1151f26
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import requests
from bs4 import BeautifulSoup


class Scraper:
    @staticmethod
    def fetch_html(url: str) -> str:
        response = requests.get(url)
        response.raise_for_status()
        return response.text

    @staticmethod
    def get_soup(html_content: str, **parser_options) -> BeautifulSoup:
        return BeautifulSoup(html_content, "html.parser", **parser_options)