Skip to content

Commit

Permalink
debuger
Browse files Browse the repository at this point in the history
  • Loading branch information
salko-ua committed Dec 1, 2024
1 parent ce92f44 commit e6283cf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions olxparser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@


def get_url(url):
response = requests.get(url)
soup = BeautifulSoup(response.content, "html.parser")
return soup

try:
response = requests.get(url)
response.raise_for_status()
soup = BeautifulSoup(response.content, "html.parser")
return soup
except Exception as e:
response = requests.get(url)
raise (str(response) + "\n\n" + e)

class Information:
# Парсинг 10 перших фото
Expand Down

0 comments on commit e6283cf

Please sign in to comment.