Last active
January 12, 2016 12:33
-
-
Save arecker/1ac69f8b74c3c20a5b70 to your computer and use it in GitHub Desktop.
busbot - 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fields = {'name': 'Alex Recker', | |
'Address': '123 Sesame St', | |
'City': 'Madison', | |
'State': 'WI', | |
'Zip': '53704', | |
'email': '[email protected]'} | |
for name, value in fields.items(): | |
elem = driver.find_element_by_name(name) | |
if name == 'State': # State Dropdown | |
for option in elem.find_elements_by_tag_name('option'): | |
if option.get_attribute('value') == value: | |
option.click() | |
break | |
else: | |
elem.send_keys(value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment