def lambda_handler(*args, **kwargs): driver = WebDriverWrapper() driver.get_url('https://www.backerkit.com/admins/sign_in') driver.set_input_value_byName('admin[email]', 'YOUR_EMAIL') driver.set_input_value_byName('admin[password]', 'YOUR_PASSWORD') driver.click_byName('commit') driver.get_url('URL_OF_EXPORT_PAGE_OF_DESIRED_SEGMENT') driver.set_input_value('XPATH_OF_FILE', '\n') driver.close()
def lambda_handler(*args, **kwargs): driver = WebDriverWrapper() receiptnumber = os.getenv("RECEIPTNUMBER") driver.get_url('https://egov.uscis.gov/casestatus/landing.do') driver.set_input_value( '/html/body/div[2]/form/div/div[1]/div/div[1]/fieldset/div[1]/div[4]/input', receiptnumber) driver.click( '/html/body/div[2]/form/div/div[1]/div/div[1]/fieldset/div[2]/div[2]/input' ) example_text = driver.get_inner_html('(//div//h1)[1]') driver.close() return example_text
def lambda_handler(*args, **kwargs): driver = WebDriverWrapper() driver.get_url('https://www.google.es/') driver.set_input_value('//input[@name="q"]', '21 buttons') button = driver.find("(//input[@name='btnK'])[2]") button.send_keys(Keys.TAB) driver.click('//input[@name="btnK"]') first_google_result_title = driver.get_inner_html( '(//div[@class="rc"]//a)[1]') print("--------------------------") print(first_google_result_title) print("--------------------------") driver.close()
def lambda_handler(*args, **kwargs): driver = WebDriverWrapper() driver.get_url('https://www.google.es/') driver.set_input_value('//input[@id="lst-ib"]', '21 buttons') driver.click('//center//img[@alt="Google"]') time.sleep(0.5) driver.click('//input[@name="btnK"]') time.sleep(0.5) first_google_result_title = driver.get_inner_html( '(//div[@class="rc"]//a)[1]') print("--------------------------") print(first_google_result_title) print("--------------------------") driver.close()