【发布时间】:2020-05-27 07:33:18
【问题描述】:
我需要在 python 中将我在缓冲区(ctrl+v)中的文本粘贴到一个网站,我直接在文本框中打开网站:
driver = webdriver.Firefox()
driver.get("https//..")
item = driver.find_element_by_name('text')
item.send_keys(Keys.CONTROL + "v")
我有 python 2.7.13
从 cmd 打开网页时:
Traceback (most recent call last): #driver.get("https://bitbucket.wdc.com/plugins/servlet/ssh/account/keys/add")
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in __init__
self.service.start()
File "C:\Python27\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
【问题讨论】:
-
"python 2.13" 似乎不存在。 Python 2.7.13 does, though。另外,你写了什么来解决这个问题?您究竟在哪里遇到问题?
-
您的问题与剪贴板无关 - 它找不到您需要访问 Firefox 的
geckodriver.exe- 请参阅 github.com/mozilla/geckodriver
标签: python