llllll

Python code posted
created at 05 Aug 18:11, updated at 17 Aug 07:34

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from selenium import webdriver
import getpass

driver = webdriver.Firefox()
driver.get('https://myaccount.lib.ncsu.edu/')

user = driver.find_element_by_name('user_idp')

for option in user.find_elements_by_tag_name('option'):
     if option.text == 'NC State Unity Users':
             option.click()

user.submit()

user = driver.find_element_by_id('j_username')
username_input = raw_input("Type in your username: ")
user.send_keys(username_input)

passw = driver.find_element_by_id('j_password')
password_input = getpass.getpass("Type in your password: ")
passw.send_keys(password_input)
passw.submit()

driver.get('https://myaccount.lib.ncsu.edu/account/checkedout')

for tags in driver.find_elements_by_tag_name('a'):
    if tags.get_attribute('title')[:5] == 'renew':
        print tags.get_attribute('title')
        tags.click()
864 Bytes in 3 ms with coderay