Обновить parsers/universal.py
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -22,7 +22,7 @@ def check_url(url: str) -> bool:
|
||||
response = wp.check_url_exists(url)
|
||||
if response.status_code == 200:
|
||||
result = response.json()
|
||||
print(result["exists"])
|
||||
# print(result["exists"])
|
||||
return result["exists"]
|
||||
else:
|
||||
return False
|
||||
@@ -49,7 +49,7 @@ class UniversalParser(BaseParser):
|
||||
|
||||
try:
|
||||
response = requests.get(self.url)
|
||||
print(response.text)
|
||||
# print(response.text)
|
||||
response.raise_for_status()
|
||||
except requests.RequestException:
|
||||
print(f"Ошибка при запросе к {self.url}")
|
||||
@@ -58,7 +58,7 @@ class UniversalParser(BaseParser):
|
||||
|
||||
soup = BeautifulSoup(response.text, 'html.parser')
|
||||
base_domain = urlparse(self.url).netloc
|
||||
print(base_domain)
|
||||
# print(base_domain)
|
||||
|
||||
for a_tag in soup.find_all('a', href=True):
|
||||
href = a_tag['href'].strip()
|
||||
|
||||
Reference in New Issue
Block a user