import aiohttp import json import logging import pkg_resources import re import requests import warnings from bs4 import BeautifulSoup from typing import Union logger = logging.getLogger(name=__name__) class WappalyzerError(Exception): """ Raised for fatal Wappalyzer errors. """ pass class WebPage: """ Simple representation of a web page, decoupled from any particular HTTP library's API. """ def __init__(self, url, html, headers): """ Initialize a new WebPage object. Parameters ---------- url : str The web page URL. html : str The web page content (HTML) headers : dict The HTTP response headers """ self.url = url self.html = html self.headers = headers try: list(self.headers.keys()) except AttributeError: raise ValueError("Headers must be a dictionary-like object") self._parse_html() def _parse_html(self): """ Parse the HTML with BeautifulSoup to find