本文整理汇总了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")