Skip to content

Instantly share code, notes, and snippets.

View adrianwebb's full-sized avatar

Adrian Webb adrianwebb

  • Washington, DC
View GitHub Profile
@benselme
benselme / select2_selenium.py
Last active August 19, 2019 04:02
Simple helper class to use Select2 controls with Selenium Webdriver
from selenium.webdriver import ActionChains
class Select2(object):
def __init__(self, element):
self.browser = element.parent
self.replaced_element = element
self.element = browser.find_element_by_id(
's2id_{0}'.format(element.get_attribute('id')))
def click(self):