описание недоступности сайта
This commit is contained in:
@@ -7,11 +7,19 @@ BASE_MATCH_URL = "https://wfl.rfs.ru/match/"
|
|||||||
|
|
||||||
|
|
||||||
def fetch_html(url: str) -> str:
|
def fetch_html(url: str) -> str:
|
||||||
headers = {"User-Agent": "Mozilla/5.0", "Accept": "*/*"}
|
headers = {
|
||||||
|
"User-Agent": "Mozilla/5.0",
|
||||||
|
"Accept": "*/*"
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
r = requests.get(url, headers=headers, timeout=20)
|
r = requests.get(url, headers=headers, timeout=20)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return r.text
|
return r.text
|
||||||
|
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
return f"Сайт недоступен: {e}"
|
||||||
|
|
||||||
|
|
||||||
def extract_player_id_from_href(href: str) -> str:
|
def extract_player_id_from_href(href: str) -> str:
|
||||||
if not href:
|
if not href:
|
||||||
|
|||||||
@@ -17,11 +17,19 @@ AMPLUA_FULL = {
|
|||||||
|
|
||||||
|
|
||||||
def fetch_html(url: str) -> str:
|
def fetch_html(url: str) -> str:
|
||||||
headers = {"User-Agent": "Mozilla/5.0", "Accept": "*/*"}
|
headers = {
|
||||||
|
"User-Agent": "Mozilla/5.0",
|
||||||
|
"Accept": "*/*"
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
r = requests.get(url, headers=headers, timeout=20)
|
r = requests.get(url, headers=headers, timeout=20)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return r.text
|
return r.text
|
||||||
|
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
return f"Сайт недоступен: {e}"
|
||||||
|
|
||||||
|
|
||||||
def get_links(html: str) -> list[dict]:
|
def get_links(html: str) -> list[dict]:
|
||||||
soup = BeautifulSoup(html, "html.parser")
|
soup = BeautifulSoup(html, "html.parser")
|
||||||
|
|||||||
@@ -51,10 +51,18 @@ def parse_russian_date(date_str: str, year: int | None = None) -> datetime:
|
|||||||
|
|
||||||
|
|
||||||
def fetch_html(url: str) -> str:
|
def fetch_html(url: str) -> str:
|
||||||
headers = {"User-Agent": "Mozilla/5.0", "Accept": "*/*"}
|
headers = {
|
||||||
response = requests.get(url, headers=headers, timeout=20)
|
"User-Agent": "Mozilla/5.0",
|
||||||
response.raise_for_status()
|
"Accept": "*/*"
|
||||||
return response.text
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
r = requests.get(url, headers=headers, timeout=20)
|
||||||
|
r.raise_for_status()
|
||||||
|
return r.text
|
||||||
|
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
return f"Сайт недоступен: {e}"
|
||||||
|
|
||||||
|
|
||||||
def normalize_status(score1: str | None, score2: str | None, dt: datetime) -> str:
|
def normalize_status(score1: str | None, score2: str | None, dt: datetime) -> str:
|
||||||
|
|||||||
@@ -8,11 +8,19 @@ SEASON = "2025/2026"
|
|||||||
|
|
||||||
|
|
||||||
def fetch_html(url: str) -> str:
|
def fetch_html(url: str) -> str:
|
||||||
headers = {"User-Agent": "Mozilla/5.0", "Accept": "*/*"}
|
headers = {
|
||||||
|
"User-Agent": "Mozilla/5.0",
|
||||||
|
"Accept": "*/*"
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
r = requests.get(url, headers=headers, timeout=20)
|
r = requests.get(url, headers=headers, timeout=20)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return r.text
|
return r.text
|
||||||
|
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
return f"Сайт недоступен: {e}"
|
||||||
|
|
||||||
|
|
||||||
def parse_standings(html: str) -> list[dict]:
|
def parse_standings(html: str) -> list[dict]:
|
||||||
soup = BeautifulSoup(html, "html.parser")
|
soup = BeautifulSoup(html, "html.parser")
|
||||||
|
|||||||
@@ -9,10 +9,18 @@ TEAMS_URL = "https://wfl.rfs.ru/tournament/1061879/teams"
|
|||||||
|
|
||||||
|
|
||||||
def fetch_html(url: str) -> str:
|
def fetch_html(url: str) -> str:
|
||||||
headers = {"User-Agent": "Mozilla/5.0", "Accept": "*/*"}
|
headers = {
|
||||||
response = requests.get(url, timeout=30, headers=headers)
|
"User-Agent": "Mozilla/5.0",
|
||||||
response.raise_for_status()
|
"Accept": "*/*"
|
||||||
return response.text
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
r = requests.get(url, headers=headers, timeout=20)
|
||||||
|
r.raise_for_status()
|
||||||
|
return r.text
|
||||||
|
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
return f"Сайт недоступен: {e}"
|
||||||
|
|
||||||
|
|
||||||
def get_links(html) -> list:
|
def get_links(html) -> list:
|
||||||
|
|||||||
Reference in New Issue
Block a user