Skip to content

Commit

Permalink
Better process logs in update_database function
Browse files Browse the repository at this point in the history
  • Loading branch information
Itz-fork committed Jul 31, 2022
1 parent 6e97931 commit 83649f0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions FakeAgent/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ def update_database():
"""
BROWSERS = ["Chrome", "Firefox", "Edge",
"Opera", "Safari", "Internet Explorer"]


print("Starting to update local database...\n")

for browser in BROWSERS:
print(f"[+] Scraping {browser}")
print(f"\r[+] Scraping: {browser}", end="")

resp = get(
f"http://useragentstring.com/pages/useragentstring.php?name={browser}")
Expand All @@ -29,7 +31,6 @@ def update_database():
with open("{}/data/{}.json".format(dirname(__file__), browser.replace(" ", "")), 'w') as f:
dump(to_wrtie, f, indent=4)

print(
f"[✅] Done adding {len(agents)} of {browser} user agents to the local database!\n\n")
print(f"\x1b[2K\r[✅] Added: {len(agents)} of {browser} user agents")

print("\n User-agents database has been updated! \n")

0 comments on commit 83649f0

Please sign in to comment.