import requests
from bs4 import BeautifulSoup


class WebScraper:
    @staticmethod
    def fetch(url):
        response = requests.get(url)
        return response.text

    @staticmethod
    def parse(html, selector):
        soup = BeautifulSoup(html, "lxml")
        elements = soup.select(selector)
        return [el.get_text(strip=True) for el in elements]

    @staticmethod
    def get_text(html, selector):
        soup = BeautifulSoup(html, "lxml")
        element = soup.select_one(selector)
        return element.get_text(strip=True) if element else None
