delay_choice = [2,3,4,5,6,7,8] #seconds #read_file should have NPI's in col A and provider names in col B read_file = "cigna.csv" write_file = "uhos.csv" f = open(read_file, "r") #overwrite data in write_file, create header docob.write_header(write_file) count = 1 #keeps count of how many providers have been scraped for line in f: #delay random choice from delay_choice wait = random.choice(delay_choice) time.sleep(wait) #Parse read_file data line = line.split(",") npi = line[0] name = line[1] #create doctor object, update attributes, write to csv file d = docob.Doctor(npi, name) d.update() d.write_csv(write_file) #print count of providers completed print(count) count += 1
f.close() f = open(read_file, "r") count = 0 linenum = 0 #append each docotor object to a dictionary for line in f: if linenum < run_limit and linenum >= start_read: dst = time.time() #Parse read_file data line = line.split(",") npi = line[0] name = line[1] org = "NYU Langone Hospital Brooklyn" #create doctor object, update attributes, write to dictionary d = docob.Doctor(npi, name, org) d.update() doclis.append(d) #delay response time times multiplier print("response time: ", str(d.response_time)) response.append(d.response_time) time.sleep(d.response_time * multiplier) den = time.time() #print count of providers completed count += 1 tim.append( den - dst )
import docob import sys var = sys.argv if len(var) > 1: head = "headless" else: head = None driver = docob.open_chrome(head) d = docob.Doctor("1518953462", "Name", driver) #d = docob.Doctor("151isfadfs8953462", "Name", driver) d.check_in_dir() d.update_location() for addy in d.address_list: print(addy) driver.close()
import docob d = docob.Doctor(1851300875, "Jason") print(d.check_in_dir()) d.update_photo() print(d.headshot)
f = open(read_file, "r") count = 0 linenum = 0 driver = docob.open_chrome(head) #append each docotor object to a dictionary for line in f: if linenum < run_limit and linenum >= start_read: dst = time.time() #Parse read_file data line = line.split(",") npi = line[0] name = line[1] org = line[2] #create doctor object, update attributes, write to dictionary d = docob.Doctor(npi, name, org, driver) d.update() doclis.append(d) #delay response time times multiplier print("response time: ", str(d.response_time)) response.append(d.response_time) time.sleep(d.response_time * multiplier) den = time.time() #print count of providers completed count += 1 if count > 1: tim.append(den - dst) newtim.append(den - dst)