sources: remove unused function
This commit is contained in:
parent
832c903e81
commit
9de6689954
|
@ -6,10 +6,9 @@ from logging import getLogger
|
|||
from pathlib import Path
|
||||
from re import Pattern
|
||||
from re import compile as re_compile
|
||||
from typing import AsyncGenerator, AsyncIterable, Optional, cast
|
||||
from typing import AsyncGenerator, Optional, cast
|
||||
|
||||
from aiohttp import ClientConnectionError, ClientPayloadError, ClientSession
|
||||
from bs4 import BeautifulSoup
|
||||
from playwright.async_api import BrowserContext, Error, Page, Route
|
||||
from playwright.async_api import TimeoutError as PlaywrightTimeoutError
|
||||
from playwright.async_api import ViewportSize, async_playwright
|
||||
|
@ -157,15 +156,3 @@ class OverrideSource(Source):
|
|||
return mapped_file.read()
|
||||
|
||||
return await self._next_source.get_url(url)
|
||||
|
||||
|
||||
async def get_page_stylesheets(source: Source, url: str) -> AsyncIterable[str]:
|
||||
"""Return styleheets urls for a given page."""
|
||||
page_content = await source.get_url(url)
|
||||
page_html = BeautifulSoup(page_content, features="html5lib")
|
||||
links = page_html.find_all("link")
|
||||
for link in links:
|
||||
if "stylesheet" not in link.get("rel", []):
|
||||
continue
|
||||
|
||||
yield link["href"]
|
||||
|
|
Loading…
Reference in New Issue