mardi 14 juin 2016

python selenium send_keys CONTROL, 'c' not copying actual text


I successfully highlight the section in a web page, but send_keys, .send_keys(Keys.CONTROL, "c"), does not place the intended text to copy in clipboard, only the last thing I manually copied is in clipboard:

from selenium import webdriver 

from selenium.webdriver.common.keys import Keys 

driver = webdriver.Firefox() 

driver.get("http://www.somesite.com") 

driver.find_element_by_id("some id").send_keys(Keys.CONTROL, "a") #this successfully highlights section I need to copy 

elem.send_keys(Keys.CONTROL, "c") # this does not actually copy text**

I tried then using the Firefox edit menu to select all and copy text, but didn't work either and cant find anything online to assist other than possible mention of a bug (tried old version of Firefox, but didn't solve issue). Any ideas?


Aucun commentaire:

Enregistrer un commentaire