如何查看python selenium的api
經常發現很多同學裝好了python+selenium webdriver開發環境后不知道怎么去查看api文檔,在這里乙醇簡單介紹一下具體方法,其實非常簡單。
首先打開命令行,在dos窗口輸入:
1
|
python -m pydoc -p
4567
|
簡單解釋一下:
- python -m pydoc表示打開pydoc模塊,pydoc是查看python文檔的首選工具;
- -p 4567表示在4567端口上啟動server;
然后在瀏覽器中訪問http://localhost:4567/,此時應該可以看到python中所有的Modules
按ctrl+f,輸入selenium,定位到selenium文檔的鏈接,然后點擊進入到http://localhost:4567/selenium.html這個頁面
這就是selenium文檔所在的位置了,接下來便可以根據自己的需要進行查看了。舉個例子,如果你想查看Webdriver類的基本方法,可以訪問這個頁面http://localhost:4567/selenium.webdriver.remote.webdriver.html