fix: use a diff scraper for now
This commit is contained in:
parent
eb3f93587f
commit
dfd8275421
3 changed files with 8 additions and 10 deletions
|
|
@ -6,7 +6,7 @@ import sys
|
|||
from typing import Any
|
||||
|
||||
import httpx
|
||||
from scrapling.fetchers import StealthyFetcher
|
||||
from scrapling.fetchers import Fetcher
|
||||
|
||||
from .base import BaseScraper
|
||||
from .models import (
|
||||
|
|
@ -52,7 +52,7 @@ def _extract_memory_limit(html: str) -> float:
|
|||
|
||||
|
||||
def _fetch_html_sync(url: str) -> str:
|
||||
response = StealthyFetcher.fetch(url, headless=True, network_idle=True)
|
||||
response = Fetcher.get(url)
|
||||
return str(response.body)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from typing import Any
|
|||
|
||||
import requests
|
||||
from bs4 import BeautifulSoup, Tag
|
||||
from scrapling.fetchers import StealthyFetcher
|
||||
from scrapling.fetchers import Fetcher
|
||||
|
||||
from .base import BaseScraper
|
||||
from .models import (
|
||||
|
|
@ -143,10 +143,8 @@ def _is_interactive(block: Tag) -> bool:
|
|||
|
||||
def _fetch_problems_html(contest_id: str) -> str:
|
||||
url = f"{BASE_URL}/contest/{contest_id}/problems"
|
||||
page = StealthyFetcher.fetch(
|
||||
page = Fetcher.get(
|
||||
url,
|
||||
headless=True,
|
||||
solve_cloudflare=True,
|
||||
)
|
||||
return page.html_content
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue