def login(login, passw, fbname): chrome_driver_path = get_driver_path() + '\\chromedriver.exe' driver = webdriver.Chrome(chrome_driver_path) token = get_access_token(login, passw) tm = TinderMessageBot() id = get_facebook_ID(driver, fbname) driver.quit() tm.logIn(id, token) return tm
def main(login, password): chrome_driver_path = get_driver_path() + '\\chromedriver.exe' driver = webdriver.Chrome(chrome_driver_path) driver.implicitly_wait(2) skype_bot = SkypeBot(driver) authentication = [login, password] skype_bot.login(authentication) skype_bot.select("Echo") skype_bot.select("Szopy Reaktywacja!") skype_bot.send_message_to_selected(characters(10000, 10500))
def setUp(self): if self.remote: # self.driver = WebDriver("http://localhost:4444/wd/hub", "chrome", "ANY") self.driver = WebDriver("http://localhost:4444", DesiredCapabilities.CHROME) else: chrome_driver_path = get_driver_path() + '\\chromedriver.exe' self.driver = webdriver.Chrome(chrome_driver_path) self.driver.get(server) self.calculator = CalculatorElements(self.driver) self.driver.maximize_window() self.driver.implicitly_wait(10)
def main(login, password, names): update_songs_distribution() tinder_bot = TinderMessageBot() chrome_driver_path = get_driver_path() + '\\chromedriver.exe' driver = webdriver.Chrome(chrome_driver_path) with open(FOLDER_PATH, 'r') as f: songs_list = f.read() songs_list = songs_list.split("\n") song_title = choice(songs_list) adapter = TinderAdapter(tiderBot=tinder_bot, name='tomasz.dworowy', receivers=names, driver=driver) song = ApiAdapter(adapter) song.my_logging.log().info("Get random song") song.login(login, password) url = get_youtube_url(song_title.strip()) song.sent_messages([url])
def set_up(context): context.my_loggin = MyLogging() remote = False if remote: # self.driver = WebDriver("http://localhost:4444/wd/hub", "chrome", "ANY") # context.driver = WebDriver("http://192.168.99.100:5000", DesiredCapabilities.CHROME) # context.driver = WebDriver(command_executor="http://192.168.99.100:5000/wd/hub", desired_capabilities=DesiredCapabilities.CHROME,proxy=None) # options = webdriver.ChromeOptions context.driver = WebDriver( command_executor="http://192.168.99.100:5000/wd/hub", desired_capabilities=CHROME) # context.driver = webdriver.Remote( # command_executor='http://192.168.99.100:5000/wd/hub', # desired_capabilities={'browserName': 'chrome', 'javascriptEnabled': True}) # don't work becouse grid bug else: chrome_driver_path = get_driver_path() + '\\chromedriver.exe' context.driver = webdriver.Chrome(chrome_driver_path) context.driver.get(SERVER) context.calculator = CalculatorElements(context.driver) # context.driver.maximize_window() context.driver.implicitly_wait(10)
def main(login, password, groups): chrome_driver_path = get_driver_path() + '\\chromedriver.exe' driver = webdriver.Chrome(chrome_driver_path) update_songs_distribution() skype_api = SkypeApi() skype_bot = SkypeBot(driver) skype_adapter = SkypeApiAdapter(skype_api, groups=groups) skype_bot_adapter = SkypeBotAdapter(skype_bot, groups=groups) song_api = ApiAdapter(skype_adapter) song_ui = ApiAdapter(skype_bot_adapter) song_api.my_logging.log().info("Get random song") with open(FOLDER_PATH, 'r') as f: songs = f.read() songs = songs.split("\n") song_title = choice(songs) url = get_youtube_url(song_title.strip()) try: song_api.login(login, password) song_api.sent_messages([url]) except Exception as e: song_ui.my_logging.log().error("API error: %s" % str(e)) song_ui.login(login, password) song_ui.sent_messages(url)
from Chrome_Driver_Folder.driver_path import get_driver_path selenium_server_path = "D:\selenium" driver_path = get_driver_path() + '/chromedriver.exe' node = "java -jar -Dwebdriver.chrome.driver=" + driver_path + "selenium-server-standalone-3.3.1.jar -host localhost " \ "-role webdriver -hub " \ "http://192.168.0.102:4444/grid/register -port 5555 " \ "-browser browserName=chrome,maxInstances=5," \ "platform=WINDOWS " node_execution = "cd " + selenium_server_path + "&& D: &&" + node print(node_execution) def run(command): import os os.system(command) if __name__ == "__main__": run(node_execution)
public.click() if vis is visibilityEnum.me: onlyMe = self.driver.find_elements_by_xpath( "//*[contains(text(), 'Only me')]") onlyMe.click() def post(self, content, vis): post_filed = self.driver.find_element_by_css_selector( "div[role='presentation']") post_filed.click() post_filed.send_keys(content) self.set_visibility(vis) post_button = self.driver.find_element_by_css_selector( "button[data-testid='react-composer-post-button'") post_button.click() if __name__ == '__main__': chrome_driver_path = get_driver_path() + '\\chromedriver.exe' driver = webdriver.Chrome(chrome_driver_path) driver.maximize_window() driver.implicitly_wait(2) fb = FacebookBot(driver) f = open(os.path.dirname(os.path.abspath(__file__)) + '\\aut.txt') fb.login_facebook((f.readline().strip(), f.readline().strip())) fb.post("Test", visibilityEnum.me)
def set_up(self): chrome_driver_path = get_driver_path() + '\\chromedriver.exe' self.driver = webdriver.Chrome(chrome_driver_path) self.driver.implicitly_wait(2) self.skype_bot = SkypeBot(self.driver)
def set_up(self, page_id, app_id, app_secret): update_songs_distribution() chrome_driver_path = get_driver_path() + '\\chromedriver.exe' self.driver = webdriver.Chrome(chrome_driver_path) self.driver.implicitly_wait(2) self.face_bot = FaceBookPost(page_id, app_id, app_secret)