本文整理匯總了Python中selenium.webdriver.common.keys.Keys.COMMAND屬性的典型用法代碼示例。如果您正苦於以下問題:Python Keys.COMMAND屬性的具體用法?Python Keys.COMMAND怎麽用?Python Keys.COMMAND使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類selenium.webdriver.common.keys.Keys
的用法示例。
在下文中一共展示了Keys.COMMAND屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: start_captcha
# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import COMMAND [as 別名]
def start_captcha():
driver = webdriver.Firefox()
driver.get("http://reddit.com")
driver.find_element(By.XPATH, "//*[@id=\"header-bottom-right\"]/span[1]/a").click()
time.sleep(1)
driver.find_element(By.ID, "user_reg").send_keys("qwertyuiop091231")
driver.find_element(By.ID, "passwd_reg").send_keys("THISISMYPASSWORD!!$")
driver.find_element(By.ID, "passwd2_reg").send_keys("THISISMYPASSWORD!!$")
driver.find_element(By.ID, "email_reg").send_keys("biggie.smalls123@gmail.com")
#driver.find_element_by_tag_name("body").send_keys(Keys.COMMAND + Keys.ALT + 'k')
iframeSwitch = driver.find_element(By.XPATH, "//*[@id=\"register-form\"]/div[6]/div/div/div/iframe")
driver.switch_to.frame(iframeSwitch)
driver.find_element(By.ID, "recaptcha-anchor").click()
# download captcha image
#
# split payload
#
# reverse_search
#
# driver.quit()
# determines if an image keywords matches the target keyword
# uses the synonyms of the image keyword
示例2: select_all
# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import COMMAND [as 別名]
def select_all(self):
elem = self.__get_element(self.k, self.v)
if platform.system().lower() == "darwin":
elem.send_keys(Keys.COMMAND, "a")
else:
elem.send_keys(Keys.CONTROL, "a")
示例3: cut
# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import COMMAND [as 別名]
def cut(self):
elem = self.__get_element(self.k, self.v)
if platform.system().lower() == "darwin":
elem.send_keys(Keys.COMMAND, "x")
else:
elem.send_keys(Keys.CONTROL, "x")
示例4: copy
# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import COMMAND [as 別名]
def copy(self):
elem = self.__get_element(self.k, self.v)
if platform.system().lower() == "darwin":
elem.send_keys(Keys.COMMAND, "c")
else:
elem.send_keys(Keys.CONTROL, "c")
示例5: paste
# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import COMMAND [as 別名]
def paste(self):
elem = self.__get_element(self.k, self.v)
if platform.system().lower() == "darwin":
elem.send_keys(Keys.COMMAND, "v")
else:
elem.send_keys(Keys.CONTROL, "v")
示例6: control_key
# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import COMMAND [as 別名]
def control_key(self):
is_osx = self.platform.startswith('OS X')
return Keys.COMMAND if is_osx else Keys.CONTROL
示例7: select_all
# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import COMMAND [as 別名]
def select_all(self):
if platform.system().lower() == "darwin":
self.elem.send_keys(Keys.COMMAND, "a")
else:
self.elem.send_keys(Keys.CONTROL, "a")
示例8: cut
# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import COMMAND [as 別名]
def cut(self):
if platform.system().lower() == "darwin":
self.elem.send_keys(Keys.COMMAND, "x")
else:
self.elem.send_keys(Keys.CONTROL, "x")
示例9: copy
# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import COMMAND [as 別名]
def copy(self):
if platform.system().lower() == "darwin":
self.elem.send_keys(Keys.COMMAND, "c")
else:
self.elem.send_keys(Keys.CONTROL, "c")
示例10: paste
# 需要導入模塊: from selenium.webdriver.common.keys import Keys [as 別名]
# 或者: from selenium.webdriver.common.keys.Keys import COMMAND [as 別名]
def paste(self):
if platform.system().lower() == "darwin":
self.elem.send_keys(Keys.COMMAND, "v")
else:
self.elem.send_keys(Keys.CONTROL, "v")