Skip to content

Commit

Permalink
Useless loop removed, updated code
Browse files Browse the repository at this point in the history
  • Loading branch information
MrManiesh committed Dec 2, 2023
1 parent 630c82b commit 28898e0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions amazon.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ def search_item(prod_name):

response = requests.get(url, headers=header)

for one in range(50):
if response.status_code != 200:
sys.exit(f"Unable to get the page. Error code: {response.status_code}")
else:
break
if response.status_code != 200:
sys.exit(f"Unable to get the page. Error code: {response.status_code}")

html_text = response.text

Expand Down

0 comments on commit 28898e0

Please sign in to comment.