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 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 validate_elements(val_brutebot): global val2_output tmp_driver = Browser(showWindow=False, proxy=brutebot.proxy) tmp_driver.go_to(val_brutebot.target) time.sleep(val_brutebot.time_in_seconds) x = tmp_driver.exists(val_brutebot.uid, css_selector=str('input[type=text][id="{}"]').format(brutebot.uid)) y = tmp_driver.exists(val_brutebot.pid, css_selector=str('input[type=password][id="{}"]').format(brutebot.pid)) z = tmp_driver.exists(val_brutebot.button_name, css_selector=str('button[type=submit][value="{}"]' or 'input[type=submit][value="{}"]').format(brutebot.button_name)) if x and y and z: time.sleep(val_brutebot.time_in_seconds) tmp_driver.close_current_tab() val2_output = True print_green(f"[!] The specified URL and the login page elements seem OK.\n") sys.exit() else: print_red( '[!] Error: The specified URL / login page elements could not be found. Please check & try again.\n\n' '[!] Exiting program!\n') val2_output = False sys.exit()
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 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 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 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 get_profile(user_data, out: str): """ Gets user profile from ebird. Users webbot to login to ebird.org and searches for user profile address on sample checklist entry for user. :param checklist_url: path to a checklist url, extracted from users dataframe column :param out: path to output text file :return: None """ user_name = user_data[1].split('/')[0].strip() checklist_url = user_data[0] web = Browser(showWindow=False) web.go_to("https://secure.birds.cornell.edu/cassso/login") web.type('birds_of_a_feather', into='Username') web.type('y&2m#9B3B2NGGzp', into='Password') web.press(web.Key.ENTER) web.go_to(checklist_url) source = web.get_page_source() soup = BeautifulSoup(source, 'lxml') try: url = soup.find('a', {'title': f'Profile page for {user_name}'})['href'] profile = f"https://ebird.org/{url}" with open(out, 'a') as src: src.write(f"{checklist_url}_{profile}\n") except TypeError: with open(out, 'a') as src: src.write(f"{checklist_url}_None\n")
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 main(self): for i in range(0, len(self.email)): web = Browser() #self.hide() web.go_to('https://www.youtube.com/watch?v=QyAR5kCvDhQ') #web.type(self.email[i] , into='First') #web.type(self.email[i] , into='Last') sleep(50)
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 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)
def openUrl(url): try: web = Browser() web.go_to(url) return web except: return "Not valid website"
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)
class WMProcess(): """ Walmart login credentials/process """ def __init__(self): config = configparser.ConfigParser() config.read("../configs/credentials.conf") #setup login and site information self.username = config['creds']['username'] self.pw = config['creds']['pw'] self.site = retailers['wm_home'] self.ps5 = consoles['ps5'] self.ps5_digital = consoles['ps5_digital'] self.xbox = consoles['xbox'] self.web = Browser() def open_browser(self): #gc = webdriver.Chrome(r"../configs/drivers/chromedriver_win32/chromedriver.exe") #gc.get(self.site) self.web.go_to(self.site) sleep(2) def login(self): self.web.click('Account') self.web.click('Sign In') self.web.type(self.username, into='email') self.web.type(self.pw, into='password') self.web.click('Sign In') #change this line below for ps5, ps5_base, or xbox self.web.go_to(self.ps5) def add_to_cart(self): self.web.click('Add to cart') def checkout(self): self.web.click('Check out') def delivery(self): self.web.click('Continue') sleep(1) def confirm_address(self): self.web.click('Continue') def select_payment(self): self.web.click('Continue') def review_order(self): self.web.click('Review your order') def place_order(self): self.web.click('Place order') def main(self): self.open_browser()
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 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 scanFacebookPage(url): if 'facebook.com' in url: web = Browser() web.go_to(url) try: pagina = web.find_elements(id='content') for elem in pagina[0].find_elements_by_tag_name('a'): if elem.get_attribute('href'): getEvent(elem.get_attribute('href')) except: print(url,"Nu am putut colecta toate datele")
def getEvent(url): if 'facebook.com/events/' in url: web = Browser() web.go_to(url) try: newEvent = Event() pagina = web.find_elements(id='content_container') eventHead= pagina[0].find_element_by_id('event_header') primary= eventHead.find_element_by_id('event_header_primary') link= primary.find_element_by_tag_name('img').get_attribute('src') titlu= primary.find_element_by_id('seo_h1_tag').text newEvent.title=titlu newEvent.tags= tags_controller.get_Tags(newEvent.title) newEvent.image_link=link sumar= eventHead.find_element_by_id('event_summary') data= sumar.find_element_by_id('event_time_info') for x in data.find_elements_by_css_selector("*"): if x.get_attribute('content'): y = x.get_attribute('content').split('to') newEvent.date = parser.parse(y[0]) x= data.find_element_by_xpath("./following-sibling::li") location= x.text[x.text.find('\n'):x.text.rfind('\n')] newEvent.location=location detalii=pagina[0].find_element_by_id('reaction_units') for elem in detalii.find_elements_by_css_selector("*"): if elem.get_attribute('data-testid') == 'event-permalink-details': newEvent.description = elem.text newEvent.tags+= tags_controller.get_Tags(newEvent.description) if detalii.find_element_by_tag_name('ul'): newEvent.tags += tags_controller.get_Tags(detalii.find_element_by_tag_name('ul').text) newEvent.put() web.close_current_tab() except : print("Nu am putut colecta toate datele") else: print('Bad url')
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 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 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 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 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 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 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 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 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 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
def download_file_rj(music_or_video, file_type, regex_file, ch_actions): context.bot.send_message(chat_id=chat_id, text="کمی صبر کنید...") if res != "inv": web = Browser() web.go_to(url) s = web.get_page_source() web.close_current_tab() soup = BeautifulSoup(s, 'html.parser') # finde mp3 link file_name = str(re.findall(fr"{regex_file}", str(soup))) file_name = file_name.replace("['", "") file_name = file_name.replace("']", "") file_url = f"https://host2.rj-mw1.com/{file_type}{file_name}.mp{music_or_video}" req = urllib.request.Request(file_url) with urllib.request.urlopen(req) as response: the_file_url_page = str(response.read()) if the_file_url_page != "b'Not found'": wget.download(file_url, f'{file_name}.mp{music_or_video}') else: try: os.remove(f"{file_name}.mp{music_or_video}") except: pass file_url = f"https://host1.rj-mw1.com/{file_type}{file_name}.mp{music_or_video}" wget.download(file_url, f'{file_name}.mp{music_or_video}') file_caption = str(file_name) #name fixed file_caption = file_caption.replace("-"," ") if str(file_name) == "[]": context.bot.send_chat_action(chat_id, ChatAction.TYPING) context.bot.send_message(chat_id=chat_id, text="لینک اشتباه است. \n\n لطفا لینک آهنگ یا موزیک ویدیوی مورد نظر را از رادیو جوان بفرستید.") else: if ch_actions == "music": context.bot.send_chat_action(chat_id, ChatAction.UPLOAD_AUDIO) context.bot.send_audio(chat_id=chat_id, audio=open(f"./{file_name}.mp{music_or_video}", "rb"), caption=f"{file_caption}") elif ch_actions == "video": context.bot.send_chat_action(chat_id, ChatAction.UPLOAD_VIDEO) context.bot.send_video(chat_id=chat_id, video=open(f"./{file_name}.mp{music_or_video}", "rb"), caption=f"{file_caption}") if os.path.exists(f"{file_name}.mp{music_or_video}"): os.remove(f"{file_name}.mp{music_or_video}")