Skip to content

Commit

Permalink
corrected mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
Midnight95 committed Oct 3, 2023
1 parent c5462fd commit 9bc74af
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions page_analyzer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,10 @@ def check_url(id):
render_url(id=id, table='urls', col='id')[0]['name'],
timeout=5
)
except (
requests.Timeout,
requests.ConnectionError,
requests.HTTPError,
requests.RequestException
):
page.raise_for_status()
except requests.RequestException:
flash('Произошла ошибка при проверке', 'error')
return redirect(url_for('url_info', id=id))
else:
if page.status_code != 200:
flash('Произошла ошибка при проверке', 'danger')

soup = BeautifulSoup(page.text, 'html.parser')
crutch = soup.find('meta', attrs={'name': 'description'})
Expand Down

0 comments on commit 9bc74af

Please sign in to comment.