With ThreadPoolExecutor(max_workers=2) as t: With ThreadPoolExecutor(max_workers=1) as t: Would you like to try again for the following counties? (Y/N) \n") #If all of the data were downloaded, we're done! #If none or only some of the data were downloaded, the user is prompted to try what wasn't done Handles) #Switch to what should be the only tab leftĭriver.close() #Close the window because (hopefully) we're doneĪll_counties, home_dir) #Let's see if we're done or not Handles = driver.window_handles #What tabs are open? This makes sure the page loads before we do anything X) #This should let the page load before doing anythingĭriver.get(url) #Open the page with the results Print('The data for all counties have already been scraped')ĭriver = webdriver.Firefox() #We're using firefox as our browser Print('Scraping data for the following counties: ')Įlse: #All data have already been downloaded If counties = all_counties: #No data has been scraped alreadyĮlif len(counties) != 0: #Some counties have been done, but not all #(useful if some counties fail and you want to retry later)Ĭounties = check_for_downloads(all_counties, home_dir) #See if any of the data have already been downloaded #Make sure each county has its own directoryĬheck_directories(all_counties, home_dir) 'Whitfield', 'Wilcox', 'Wilkes', 'Wilkinson', 'Worth' 'Warren', 'Washington', 'Wayne', 'Webster', 'Wheeler', 'White', 'Terrell', 'Thomas', 'Tift', 'Toombs', 'Towns', 'Treutlen', 'Troup', 'Sumter', 'Talbot', 'Taliaferro', 'Tattnall', 'Taylor', 'Telfair', 'Schley', 'Screven', 'Seminole', 'Spalding', 'Stephens', 'Stewart', 'Putnam', 'Quitman', 'Rabun', 'Randolph', 'Richmond', 'Rockdale', 'Paulding', 'Peach', 'Pickens', 'Pierce', 'Pike', 'Polk', 'Pulaski', 'Morgan', 'Murray', 'Muscogee', 'Newton', 'Oconee', 'Oglethorpe', 'McIntosh', 'Meriwether', 'Miller', 'Mitchell', 'Monroe', 'Montgomery', 'Lowndes', 'Lumpkin', 'Macon', 'Madison', 'Marion', 'McDuffie', 'Jasper', 'Jeff_Davis', 'Jefferson', 'Jenkins', 'Johnson', 'Jones', 'Greene', 'Gwinnett', 'Habersham', 'Hall', 'Hancock', 'Haralson', 'Franklin', 'Fulton', 'Gilmer', 'Glascock', 'Glynn', 'Gordon', 'Grady', 'Elbert', 'Emanuel', 'Evans', 'Fannin', 'Fayette', 'Floyd', 'Forsyth', 'Dooly', 'Dougherty', 'Douglas', 'Early', 'Echols', 'Effingham', 'Crawford', 'Crisp', 'Dade', 'Dawson', 'Decatur', 'DeKalb', 'Dodge', 'Clinch', 'Cobb', 'Coffee', 'Colquitt', 'Columbia', 'Cook', 'Coweta', 'Chattahoochee', 'Chattooga', 'Cherokee', 'Clarke', 'Clay', 'Clayton', 'Candler', 'Carroll', 'Catoosa', 'Charlton', 'Chatham', 'Brooks', 'Bryan', 'Bulloch', 'Burke', 'Butts', 'Calhoun', 'Camden', 'Bartow', 'Ben_Hill', 'Berrien', 'Bibb', 'Bleckley', 'Brantley', 'Appling', 'Atkinson', 'Bacon', 'Baker', 'Baldwin', 'Banks', 'Barrow', Home_dir = eg.diropenbox('', 'Choose download destination directory') X = 15 #Number of seconds for the wait timers # show the box again, with the errmsg as the messageįieldValues = eg.multenterbox(errmsg, title, fieldNames, fieldValues) Press start to begin download', title=self.title, ok_button='Start Download')Įg.msgbox(msg='Completed! Downloaded ' + str(reply) + ' in ' + str(reply) + ' seconds', title=self.title, ok_button='Main menu') There are ' + str(len(favorites)) + ' to download. Please try again."Įg.msgbox(msg='Press start to begin retrieving this user\'s likes (This may take a while)', title=self.title, ok_button='Start Retrieval')Įg.msgbox(msg='We have all their favorites. Self.downloader = scLikesDownloader.downloader(fieldValues, path)Įrrmsg = "Invalid Path or SoundCloud Profile URL. Path = eg.diropenbox(msg="Select a folder to save the mp3 files to", title=self.title) While 1: # do forever, until we find acceptable values and break outĮrrmsg = errmsg + ('"%s" is a required field.\n\n' % fieldNames) # make sure that none of the fields was left blank FieldValues = # we start with blanks for the valuesįieldValues = eg.multenterbox(msg,title, fieldNames, values=fieldValues)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |