def main(): # Creating SELLER_INFO === To be used with artwork entry sellers = db.Sellers() sellers.read_data_sellers() # sellers.__del__() # Trying to close the connection here throws error. Maybe putting it in a function works. # Creating ARTIST_INFO === To be used with artwork entry artists = db.Artist() artists.read_artist_data() # artists.__del__() artsperpainters = Website( 'https://www.artsper.com', 'https://www.artsper.com/us/contemporary-artists/youngtalents/sculptors-artists', "ARTSPER") artsper = Artsper(artsperpainters) artsper.miner() artsperpainters = Website( 'https://www.artsper.com', 'https://www.artsper.com/us/contemporary-artists/youngtalents/painters', "ARTSPER") artsper = Artsper(artsperpainters) artsper.miner()
def write_artist(*args): # Running the data through dataStructure ArtistData artist = ArtistDS(*args) bundle = artist.artist_bundle() # bundle = [name, born, country, about] writer = db.Artist() # Create artist table if it doesn't already exist writer.create_table_artist() writer.insert_data_artists(*bundle)
def write_artist_data(self, *args) -> None: # Running the data through dataStructure ArtistData seems redundant as of now. Passing bundle directly to # dbmaip class bundle = [*args] # bundle = [url, name, born, country, about] writer = db.Artist() # Create artist table if it doesn't already exist writer.create_table_artist() writer.insert_data_artists(*bundle)
def main(): # Creating SELLER_INFO === To be used with artwork entry sellers = db.Sellers() sellers.read_data_sellers() # Creating ARTIST_INFO === To be used with artwork entry artists = db.Artist() artists.read_artist_data() webagent = Website( 'https://www.artsy.net', 'https://www.artsy.net/collection/new-and-noteworthy-artists?additional_gene_ids%5B0%5D=painting&additional_gene_ids%5B1%5D=sculpture', 'ARTSY') artsy = Artsy(webagent) artsy.miner() time.sleep(10)
def main(): # Creating SELLER_INFO === To be used with artwork entry sellers = db.Sellers() sellers.read_data_sellers() # Creating ARTIST_INFO === To be used with artwork entry artists = db.Artist() artists.read_artist_data() webagent = Website('https://www.singulart.com/en', 'https://www.singulart.com/en/painting', "SINGULART") singulart = Singulart(webagent) singulart.miner() time.sleep(10) print("FINISHED")
def main(): sellers = db.Sellers() sellers.read_data_sellers() artists = db.Artist() artists.read_artist_data() agent = Website( 'https://www.emergingartistplatform.com', 'https://www.emergingartistplatform.com/browse?Collection=Paintings&page=', "EMERGINGARTISTPLATFOM") eap = EAP(agent) eap.miner() agent = Website( 'https://www.emergingartistplatform.com', 'https://www.emergingartistplatform.com/browse?Collection=Sculptures&page=', "EMERGINGARTISTPLATFOM") eap = EAP(agent) eap.miner()
def main(): start = time.perf_counter() # Creating SELLER_INFO sellers = db.Sellers() sellers.read_data_sellers() # Creating ARTIST_INFO artists = db.Artist() artists.read_artist_data() artsperpainters = Website( 'https://www.artsper.com', 'https://www.artsper.com/us/contemporary-artists/youngtalents/painters?', "ARTSPER") a_m = Artsper(artsperpainters) a_m.artsper_mine() finish = time.perf_counter() print( f"Lap Completed in {round(finish - start, 2)}, seconds.\n Starting sculptures" ) artspersculptors = Website( 'https://www.artsper.com', 'https://www.artsper.com/us/contemporary-artists/youngtalents/sculptors-artists', "ARTSPER") a_m = Artsper(artspersculptors) a_m.artsper_mine() finish = time.perf_counter() print( f"Lap Completed in {round(finish - start, 2)}, seconds.\n Downloading and updating images" ) TheMiner.sir_image_manager() finish = time.perf_counter() print(f"Finished in {round(finish - start, 2)}, seconds")
def main(): # Creating SELLER_INFO === To be used with artwork entry sellers = db.Sellers() sellers.read_data_sellers() # Creating ARTIST_INFO === To be used with artwork entry artists = db.Artist() artists.read_artist_data() kazoart_webagent = Website('https://www.kazoart.com', 'https://www.kazoart.com/en/artistes/technique/sculpture?eme=1', "KAZOART") kazoart = Kazoart(kazoart_webagent) kazoart.miner() time.sleep(10) kazoart_webagent = Website('https://www.kazoart.com', 'https://www.kazoart.com/en/artistes/technique/peintures?eme=1', "KAZOART") kazoart = Kazoart(kazoart_webagent) kazoart.miner()
def get_artist_data(self, soup, url): # with concurrent.futures.ThreadPoolExecutor() as executor: # soups = executor.map(TheMiner.fetch_page, self.artist_listing) # for soup in soups: # PICKING ARTIST DATA try: A = soup.find('div', id='biography') # Artist's name name = A.h1.text.strip() # print(name) except: name = None try: # Born A = soup.find('div', id='biography') B = A.find('div', class_='sub-title col-sm-9 col-xs-12') bo = B.find('span', class_='birthday-date').text born = "" for b in bo: if b.isdigit(): born += b # print(born) except: born = None try: # Country A = soup.find('div', id='biography') B = A.find('div', class_='sub-title col-sm-9 col-xs-12') country = B.span.text.strip() # print(country) except: country = None try: # About A = soup.find('div', id='biography') about = A.find('div', class_='col-sm-9 col-xs-12 biography').text.strip() ab = about.split(" ") about = '' for a in range(len(ab) - 1): b = ab[a] about = about + "\n" + b.strip() about = about.strip() # print(about) except: about = None # Writing artist data. # The following portion of code needs to be consistent across all the website modules. # Just extract the name, born, country and about for the artist and then repeat this portion. artist_data = ArtistData(url = url, name=name, born=born, country=country, about=about) a_bundle = artist_data.artist_bundle() artist_db_agent = db.Artist() artist_db_agent.create_table_artist() artist_db_agent.insert_data_artists(*a_bundle)