File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44
55class 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" )
You can’t perform that action at this time.
0 commit comments