目录
1、安装python+selenium webdriver 开发环境后,如何查看api文档
2、为什么selenium中已经引入过webdriver的包了,还要再引入它下面的其他包,如:webdriver.common.action_chains
1、安装python+selenium webdriver 开发环境后,如何查看api文档
a. 首先打开命令行,在doc窗口输入:pyton -m pydoc -p 4567
如下图:
b. 在浏览器中访问http://localhost:4567/,就可以看见python中所有的Modules,按下ctrl+f,输入selenium,定位到selenium文档的连接,然后点击进入到http://localhost:4567/selenium.html这个页面这就是selenium文档所在的位置了,接下来便可以根据自己的需要进行查看了。举个例子,如果你想查看Webdriver类的基本方法,可以访问这个页面http://localhost:4567/selenium.webdriver.remote.webdriver.html
- python -m pydoc 表示打开pydoc模式,pydoc是查看python文档的首选工具;
- -p 4567 表四在4567端口上启动server;
2、为什么selenium中已经引入过webdriver的包了,还要再引入它下面的其他包,如:webdriver.common.action_chains
答:
selenium只是一个包名,你在使用selenium 的时候一定要指名使用它下面的哪个 类或方法。你顺着引的包的路径,到selenium的安装目录下,看能不能找到 ActionChains 类 和 Select 类;如:C:\Python36\Lib\site-packages\selenium