Skip to content

Commit

Permalink
Update fake_traffic.py
Browse files Browse the repository at this point in the history
  • Loading branch information
deedy5 authored Aug 17, 2021
1 parent 0807953 commit 830f34b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fake_traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_url(url):
if resp.status_code == 200:
print(resp.status_code, url)
return resp
except requests.ConnectionError:
except requests.exceptions.ConnectionError:
print("Connection error. Sleep 60 sec.")
sleep(60)
except:
Expand Down Expand Up @@ -94,6 +94,7 @@ def fake_traffic(country='US', language='en-US'):
for i, url in enumerate(article_urls, start=1):
recursive_browse(url)
print(f"{i}/{len(article_urls)} urls recursive browsing.")
sleep(uniform(1, 5))

if __name__ == '__main__':
fake_traffic(country='US', language='en-US')

0 comments on commit 830f34b

Please sign in to comment.