Skip to content

Commit 37b3cf5

Browse files
committed
Update user_agent string and add prompt to indicate stages of process
1 parent 0d97251 commit 37b3cf5

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

funcs/replit_scrapper.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33

44

55
class ReplitScrapper():
6-
ua = (
7-
"""
8-
Mozilla/5.0 (Windows NT 10.0; Win64; x64)
9-
AppleWebKit/537.36 (KHTML, like Gecko)
10-
Chrome/116.0.0.0
11-
Safari/537.36
12-
Edg/116.0.1938.81
13-
"""
6+
user_agent = (
7+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
8+
"AppleWebKit/537.36 (KHTML, like Gecko) "
9+
"Chrome/116.0.0.0 "
10+
"Safari/537.36 "
11+
"Edg/116.0.1938.81"
1412
)
1513

1614
def __init__(self, login_name, login_password):
@@ -103,13 +101,14 @@ def _download_as_zip(self, page) -> None:
103101
download.save_as(f"./screen-shots/{download.suggested_filename}")
104102

105103
def run(self):
104+
print("ReplitScrapper: Begin downloading repo files...")
106105
with sync_playwright() as p:
107106
# Context setup
108107
browser = p.chromium.launch(slow_mo=50)
109108
# browser = p.chromium.launch(headless=False
110109
# , slow_mo=50
111110
# )
112-
context = browser.new_context(user_agent=ReplitScrapper.ua)
111+
context = browser.new_context(user_agent=ReplitScrapper.user_agent)
113112
page = context.new_page()
114113
stealth_sync(page)
115114

@@ -123,3 +122,4 @@ def run(self):
123122
# Clean-up
124123
context.close()
125124
browser.close()
125+
print("ReplitScrapper: Download complete")

0 commit comments

Comments
 (0)