def act(): # GOOGLE_CHROME_PATH = '/app/.apt/usr/bin/google_chrome' # CHROMEDRIVER_PATH = '/app/.chromedriver/bin/chromedriver' # chrome_options = webdriver.ChromeOptions() # chrome_options.add_argument('--disable-gpu') # chrome_options.add_argument('--no-sandbox') # chrome_options.binary_location = GOOGLE_CHROME_PATH # browser = webdriver.Chrome(CHROMEDRIVER_PATH, chrome_options=chrome_options) url = request.form['url'] user = request.form['username'] password = request.form['password'] #browser.get(url) web = Browser() web.go_to(url) web.type(user, into='Email') web.type( password, into='Password', xpath= "//*[@id='tblActivityTleDesc']/tbody/tr[4]/td[1]/table[2]/tbody/tr[4]/td[3]/input" ) # specific selection web.click( xpath= "//*[@id='tblActivityTleDesc']/tbody/tr[4]/td[1]/table[2]/tbody/tr[4]/td[4]/input" ) # you are logged in ^_^ while True: web.click(xpath="//*[@id='cardDiv']") return render_template("home.html")
def getPage(): global queries global soup print("Scarico la pagina") web = Browser() web.go_to(url_login) web.type(email, into='E-mail') web.type(password, into='Password') web.click('ACCEDI', classname='submit_access') time.sleep(delay) web.click('OFFERTE DI LAVORO') time.sleep(delay) page = web.get_page_source() web.close_current_tab() soup = BeautifulSoup(str(page), 'html.parser') print("Cerco il box degli annunci") soup = soup.find("div", id="js-grid-blog-posts") print("Inzio a filtrare i risultati per regione") global regioni_cercate for reg in regioni_cercate: print("Filtro per: " + reg) filter(soup, reg) print("Ho concluso l'esecuzione")
def go_to_oracle_page(links=(), show_window=False, use_obi=False): """Open a webbot instance and log in to Oracle, opening the link(s) specified therein. links can be a string or a list of strings. Returns the webbot instance, so you can do more things with it.""" web = Browser(showWindow=show_window) obi_url = 'https://obi.ssc.rcuk.ac.uk/analytics/saw.dll?dashboard&PortalPath=%2Fshared%2FSTFC%20Shared%2F_portal%2FSTFC%20Projects' ebs_url = 'https://ebs.ssc.rcuk.ac.uk/OA_HTML/AppsLogin' for _ in range(2): # first try without VPN connection web.go_to(obi_url if use_obi else ebs_url) if web.exists('Enter your Single Sign-On credentials below'): break # failed? try connecting to VPN subprocess.call('RASDial "RAL VPN"') else: raise RuntimeError('Failed to load Oracle login page') web.type(username, 'username') web.type(password, 'password') web.click('Login') time.sleep(2) if isinstance(links, str): links = [ links, ] for link in links: web.click(link) time.sleep(2) return web
def web_auth(auth_url, csrf_token, email, password): # Constants state_param = 'state=' code_param = 'code=' url_separator = '&' # Instantiate browser web = Browser() # Web authentication process web.go_to(auth_url) web.type(email, 'login') web.type(password, 'password') web.click('Authorize') web.click('Grant access to Box') # Get url for access code access_url = web.get_current_url() # Close browser web.close_current_tag() print("URL: " + access_url) # Get access codes access_csrf = access_url[access_url.index(state_param) + len(state_param):access_url.index(url_separator)] access_code = access_url[access_url.index(code_param) + len(code_param):] # Return access codes return access_csrf, access_code
def login(ip, password): web = Browser() web.go_to('https://'+ ip +':4444/') web.type('admin' , into='Username' , id='ELEMENT_login_username') web.type(password , into='Password' , id='ELEMENT_login_password') web.click('Login' , tag='div' , id='ELEMENT_login_button') time.sleep(15); web.close_current_tab();
def main(self): web = Browser() web.go_to("http://web.whatsapp.com/send?phone=918486372923") time.sleep(10) for i in range(0, len(self.email)): #self.hide() web.go_to("http://web.whatsapp.com/send?phone=91" + self.email[i]) time.sleep(5) web.type('https://www.youtube.com/watch?v=AWdexg484ls') time.sleep(2) web.click(classname='_3M-N-') time.sleep(4)
def main(): skipTests = [ ] #['sequence_memory', 'chimp_test', 'aim_trainer', 'typing', 'verbal_memory', 'number_memory', 'visual_memory'] driver = Browser() dashURL = 'https://humanbenchmark.com/dashboard' driver.implicitly_wait(0.05) driver.go_to(dashURL) driver.click('Accept all') for i, test in enumerate(tests.get_tests(), 1): if test.__name__ in skipTests: print('Skipping:', test.__name__) continue print('Completing:', test.__name__) if driver.get_current_url() != dashURL: print('At incorrect page:', driver.get_current_url()) driver.go_to(dashURL) time.sleep(1) driver.click('Play', number=i) driver.click('Start') test(driver) time.sleep(0.2) driver.click('Save score') driver.implicitly_wait(0.05) driver.go_to(dashURL) #Keep browser open until user exit _ = input('Press enter to exit:')
def run(self): bot = Browser(showWindow = True) bot.go_to(self.link) print("went to home page") print("checking for login") bot.maximize_window() bot.click("EUW") bot.click("LOGIN") print("click login") time.sleep(5) bot.type(self.username, into="Username") bot.type(self.password, into = "Password") bot.click("SIGN IN") print("clicked sign in") time.sleep(5) print("signed in") i = 0 for url in self.URLS: print(url) bot.go_to('https://watch.lolesports.com'+str(url)) time.sleep(3) bot.click("JUMP") time.sleep(80) temp = self.URLS.pop(i) self.DONE.append(temp) time.sleep(10) print("ok") self.save() bot.quit()
def webot(user, passwd): web = Browser(False) web.go_to("https://midas.unioeste.br/login/#/") time.sleep(5) web.type(user, id="login-username") web.type(passwd, id="login-password") web.press(web.Key.ENTER) time.sleep(5) web.click('Academus') time.sleep(5) web.click('Matrículas') time.sleep(3) data = web.get_page_source() web.close_current_tab() return data
def chimp_test(driver: Browser): driver.implicitly_wait(0.00001) roundNo = 4 squareOrder = [] while roundNo <= 40: for i in range(1, roundNo + 1): squareOrder.append( driver.find_elements(text=str(i), tag='div', number=1)) for i, square in enumerate(squareOrder): square[0].find_element_by_xpath('./..').click() roundNo += 1 squareOrder = [] driver.click('Continue')
def main(self): for i in range(0, len(self.email)): web = Browser() self.hide() web.go_to('instagram.com') time.sleep(3) web.type(self.email[i], into='Email') time.sleep(3) web.type(self.password[i], into='Password', id='passwordFieldId') web.click('Log In', tag='button') time.sleep(3) web.go_to('instagram.com/jonas.h24/') time.sleep(3) web.click('Follow', tag='span') time.sleep(2) pyautogui.hotkey('alt', 'f4')
def collect_data_spkr(date_mode, online): if date_mode == 'full' and online: web = Browser(showWindow=True) web.go_to('https://www.sparkasse-krefeld.de/de/home.html') web.type(Anmeldename, into='Anmeldename') web.type(PIN, into='PIN') web.click('Anmelden') web.click('Kontostand/Umsatzanzeige') web.type('01.01.2018', into='Zeitraum', clear=True) web.click('Export') web.click('CSV-MT940-Format') time.sleep(5) web.click('Abmelden') data_csv_path = get_newest_download(PATH_DOWNLOADS) df = pd.read_csv(data_csv_path, error_bad_lines=False, encoding='latin1', delimiter=';', decimal=',') df.set_index(['Valutadatum', 'Verwendungszweck']) df.to_csv("C:/Users/adm-mlung/Desktop/Projekte/Secrets/data/Umsatz_raw.csv") return df
def run(self): bot = Browser(showWindow=True) bot.go_to(self.login_url) print("went to home page") print("checking for login") bot.maximize_window() # if(bot.exists(text="LOGIN")): # bot.click("LOGIN") # else: # print("didn't find login") # bot.click("EUW") bot.click("EUW") bot.click("LOGIN") print("click login") time.sleep(5) bot.type(self.username, into="Username") bot.type(self.password, into="Password") bot.click("SIGN IN") print("clicked sign in") time.sleep(5) print("signed in") bot.go_to(self.watch_url) time.sleep(10) self.mission_confirmation(bot) bot.quit()
def run(self): """@brief A thread that reads stats from the LB2120 4G modem""" web = Browser() web.go_to('http://{}/index.html'.format(self._options.address)) web.click(id='session_password') web.type(self._password) #web.type('QtV6Dq4s') web.click('Sign In') web.click(id='session_password') startTime = time() while True: web.go_to("http://{}/index.html#settings/network/status".format( self._options.address)) content = web.get_page_source() now = time() elapsedTime = now - startTime startTime = now self._pollSeconds = elapsedTime soup = BeautifulSoup(content, 'html.parser') item = soup.body.find( 'dd', attrs={'class': 'm_wwan_signalStrength_rsrp'}) self._lock.acquire() self._rxp = float(item.string) self._uio.debug("4G RXP (dBm): {}".format(self._rxp)) self._lock.release() sleep(LB2120.POLL_DELAY_SECONDS)
def login(waitTime1): #start new browser web = Browser() time.sleep(waitTime1 * 2) #go to hangouts web.go_to('https://hangouts.google.com/') #sign in email web.click('Sign in') web.type('VirtualVisitas2.0', into='Email') web.click('NEXT', tag='span') time.sleep(waitTime1) #sign in password web.type('Apaar&AlbertSal', into='Password', id='passwordFieldId') web.click('NEXT', tag='span') # you are logged in . woohoooo web.click('confirm') return web
def _automate_browser_operation(pco_username, pco_password, groups, tag): web = Browser() web.go_to('https://login.planningcenteronline.com/login/new') web.type(pco_username, id='email') web.type(pco_password, id='password') web.press(web.Key.ENTER) for g in groups: if len(g[2]) > 0: skip_group = False for t in g[2]: if t == tag[0]: skip_group = True break if skip_group: continue tag_label_for = f'tag-group-tag-{tag[0]}' web.go_to(f'https://groups.planningcenteronline.com/groups/{g[0]}/settings') time.sleep(2.0) web.click('Add tags', tag='span') web.click(tag[1], tag='label', classname='checkbox-label') time.sleep(3.0)
def loginBrunel(self): driver = Browser() driver.go_to('https://teaching.brunel.ac.uk/SWS-1920/login.aspx') driver.type(self.student_id , id = 'tUserName') driver.type(self.password , id = 'tPassword') driver.click('Login') driver.click(id = 'LinkBtn_mystudentsettimetable') driver.click('View Timetable') driver.save_screenshot(PATH)
class BumbleBot: def __init__(self): self.phoneNumber = results.Number self.password = results.Password self.web = Browser() self.Login() def Login(self): self.web.go_to('https://bumble.com/app') self.web.click('Use cell phone number') self.web.type(self.phoneNumber, into='Enter your number') self.web.click('Continue') self.web.type(self.password, into='Password') self.web.click('Sign in') def Like(self): self.web.click('Like', number=3, classname='encounters-controls__action') def Pass(self): self.web.click('Pass', classname='encounters-controls__action') def LikeLoop(self): likeCount = 0 passCount = 0 count = random.randint(2, 6) #3/2 change to like someone so they (hopefully) dont think its a bot while (True): if (count % 2) == 0: self.Like() likeCount += 1 else: self.Pass() passCount += 1 count = random.randint(2, 6) print(f'Likes: {likeCount} Passes: {passCount}', end='\r')
def __init__(self, URL, whereToClick, username, typeOfUserName, password): self.URL = URL web = Browser() web.go_to(URL) web.type(username, into=typeOfUserName) web.click('NEXT', tag='span') web.type(password, into='password') web.click('NEXT', tag='span') web.click(whereToClick)
def _manager_ui_login(url, user, realm, delay=30): if config.DRY_RUN: return Browser(showWindow=False) browser_options = (['ignore-certificate-errors'] if url == 'localhost' else []) driver = Browser(showWindow=not config.QUIET, browser_options=browser_options) start = time.time() end = start driver.go_to(f'https://{url}/manager/?realm={realm}') while not driver.exists('LOG IN') and not driver.exists('SIGN IN'): if not config.QUIET: print('+', end='', flush=True) time.sleep(0.2) end = time.time() if end - start > delay: raise Exception(f'{url}: no login page after {delay}s') driver.type(user, into='username') driver.type(config.get_password(url, user), into='password') driver.click('SIGN IN') driver.click('LOG IN') end = time.time() print(f'{url} login time\t{end-start:.2f}s') return driver
def main(): reponame = input("Enter Reponame: ") web = Browser() # login to github web.go_to('github.com/login') web.type(credentials['mail'], into='Email', id='login_field') web.type(credentials['password'], into='Password', id='password') web.click(tag='input', text='Sign in') # create new repository web.go_to('github.com/new') web.type(reponame, id='repository_name') web.type("This is the computer generated repository :fire: :heart: " + reponame, id='repository_description') web.click(id="repository_auto_init") web.click(id='repo-new-license-details') web.click(id='license-label-apache-2.0') web.click(tag='button', text='Create repository')
def navigate(user='******', password='******'): global web web = Browser() web.go_to( "https://freddiemac.embs.com/FLoan/secure/login.php?pagename=download3" ) web.type(user, into='email') web.type(password, into='password') web.click('Submit Credentials') web.click('Yes') web.click('Continue')
def StartScraping(self): # Login to amazon account username = self.txtusername.text() password = self.txtpassword.text() web = Browser() web.go_to('https://affiliate-program.amazon.com/home/promohub/promocodes?ac-ms-src=nav&type=mpc&active_date_range=0') web.type(username , into='Username' , id='ap_email') web.type(password , into='Password' , id='ap_password') web.click(classname='a-button-inner') # you are logged in . oohoooo time.sleep(60) #end login # Reading CSV file # Open the input_file in read mode and output_file in write mode with open('product-data-input.csv', 'r') as read_obj, \ open('product-data-output.csv', 'w', newline='') as write_obj: # Create a csv.reader object from the input file object csv_reader = reader(read_obj) # Create a csv.writer object from the output file object csv_writer = writer(write_obj) line_count = 0 # Read each row of the input csv file as list for row in csv_reader: if line_count == 0: row.append("Full URL") csv_writer.writerow(row) line_count += 1 # Append the default text in the row / list else: self.lblcurrent.setText(str(line_count)) web.go_to(row[4]) # time.sleep(5) content = web.get_page_source() soup = BeautifulSoup(content) samples = soup.find_all("a", {"class":"a-size-base-plus a-link-normal titleLink"}) link = "aasdf" for tag in samples: link = "https://www.amazon.com"+tag['href'] web.go_to(link) break time.sleep(5) web.click( "Text", 'a') time.sleep(3) web.click( "Full Link", 'span') content = web.get_page_source() soup = BeautifulSoup(content) samples = soup.find_all("textarea", {"class":"amzn-ss-text-fulllink-textarea"}) for textareas in samples: row.append(textareas.text) # Add the updated row / list to the output file csv_writer.writerow(row) line_count += 1
def number_memory(driver: Browser): round = 1 while round <= 23: num = driver.find_elements( css_selector='div.big-number')[0].get_attribute('innerHTML') time.sleep((1 * round) + 0.7) driver.type(num) driver.click('Submit') driver.click('NEXT') round += 1 time.sleep((1 * round) + 0.7) driver.type(str(int(num) - 1)) driver.click('Submit')
def main(self): for i in range(0,len(self.email)): web = Browser() #self.hide() web.go_to('gmail.com') web.type(self.email[i] , into='Email') web.click('NEXT' , tag='span') time.sleep(2) web.type(self.password[i], into='Password' , id='passwordFieldId') web.click('NEXT' , tag='span') # you are logged in . woohoooo time.sleep(30) web.go_to('youtube.com/channel/UCuCyYWNnlm1bY2kMyFKIhfQ') time.sleep(3) web.click('Subscribe',tag='yt-formatted-string') time.sleep(20000) pyautogui.hotkey('alt','f4')
def main(self): for i in range(0, len(self.email)): web = Browser() self.hide() web.go_to('gmail.com') web.type(self.email[i], into='Email') web.click('NEXT', tag='span') time.sleep(1) web.type(self.password[i], into='Password', id='passwordFieldId') web.click('NEXT', tag='span') # you are logged in . woohoooo time.sleep(2) web.go_to('youtube.com/channel/UCfHNXbRDxJhzfZnAqu9itfw') time.sleep(1) web.click('Subscribe', tag='yt-formatted-string') time.sleep(2) pyautogui.hotkey('alt', 'f4')
def verbal_memory(driver: Browser): driver.implicitly_wait(0) wordElementParent = driver.find_elements( tag='div', css_selector='div.css-1qvtbrk.e19owgy78', loose_match=False)[1] round = 1 words = [] while round <= 1000: word = wordElementParent.get_attribute('innerHTML')[19:-6] if word in words: driver.click(text='SEEN') else: words.append(word) driver.click(text='NEW') round += 1 for i in range(3): word = wordElementParent.get_attribute('innerHTML')[19:-6] if word in words: driver.click(text='NEW') else: driver.click(text='SEEN')
def main(self): for i in range(0,len(self.email)): web = Browser('switch_to_alert') self.hide() web.go_to('mail.google.com') web.type(self.email[i] , into='Email') web.click('NEXT' , tag='span') time.sleep(1) web.type(self.password[i], into='Password' , id='passwordFieldId') web.click('NEXT' , tag='span') # you are logged in . woohoooo time.sleep(2) web.go_to('youtube.com/channel/UCSu-YBmsmjSlPTKtlKx_img/') time.sleep(1) web.click('Subscribe',tag='yt-formatted-string') time.sleep(2) pyautogui.hotkey('alt','f4')
def login(waitTime1): #start new browser web = Browser() time.sleep(waitTime1 * 2) #go to hangouts web.go_to( 'https://accounts.google.com/signin/v2/identifier?service=talk&passive=1209600&continue=https%3A%2F%2Fhangouts.google.com%2Fwebchat%2Fstart&followup=https%3A%2F%2Fhangouts.google.com%2Fwebchat%2Fstart&flowName=GlifWebSignIn&flowEntry=ServiceLogin' ) #sign in email web.type('VirtualVisitas2.0', into='Email') web.click('NEXT', tag='span') #sign in password time.sleep(waitTime1) web.type('Apaar&AlbertSal', into='Password', id='passwordFieldId') web.click('NEXT', tag='span') # you are logged in . woohoooo web.click('confirm') return web
def getJapaTalkCalendar(userName, password, useCache=False): if useCache and os.path.exists(CACHED_FILE_FN): with io.open(CACHED_FILE_FN, 'r', encoding="utf-8") as fd: pageSource = fd.read() else: web = Browser() web.go_to('https://www.japatalk.com/login_form.php') web.click(id="wID") web.type(userName) web.click(id="wPasswd") web.type(password) web.click(classname="btn-next") #web.click(classname="from-cal") web.go_to('https://www.japatalk.com/reservation_calendar.php') pageSource = web.get_page_source() if useCache: with io.open(CACHED_FILE_FN, 'w', encoding="utf-8") as fd: fd.write(pageSource) return pageSource