【问题标题】:Selenium python script in eclipseeclipse中的Selenium python脚本
【发布时间】:2017-10-12 03:35:23
【问题描述】:

我在使用 Selenium 运行 python 脚本时遇到以下错误。请帮我解决这个问题。

(Traceback (most recent call last):
File "C:\Users\WaheGuru\workspace\test\new\first.py", line 8, in <module>     
from selenium.common.keys import Keys ModuleNotFoundError: No module named 
'selenium.common.keys')

【问题讨论】:

  • 您的系统上是否安装了 selenium?如果您只尝试import selenium,会发生什么?

标签: python eclipse selenium


【解决方案1】:

好吧,如果您安装了 Python 和 selenium……那么这样的东西应该可以工作。

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

def someCode():
#Some Code to do something with some URL
    elem = driver.find_element_by_name("<Some_Elem_With_Input>")
    elem.send_keys("FOO")
    elem.send_keys(Keys.RETURN)

如果 selenium 没有安装,则运行以下命令

pip install selenium

查看http://selenium-python.readthedocs.io/installation.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-03-22
    • 2015-06-05
    • 2015-07-12
    • 2021-07-12
    • 2019-05-17
    • 1970-01-01
    • 2022-11-10
    • 2011-09-20
    相关资源
    最近更新 更多