admin管理员组文章数量:1794759
selenium python 入门教程
2. Getting Started — selenium python Bindings 2 documentation
2.1. Simple UsageIf you have installed Selenium Python bindings, you can start using it from Python like this.
from selenium import webdriver from selenium.webdrivermon.keys import Keys from selenium.webdrivermon.by import By driver = webdriver.Firefox() driver.get("www.python") assert "Python" in driver.title elem = driver.find_element(By.NAME, "q") elem.clear() elem.send_keys("pycon") elem.send_keys(Keys.RETURN) assert "No results found." not in driver.page_source driver.close()The above script can be saved into a file (eg:- python_org_search.py), then it can be run like this:
python python_org_search.pyThe python which you are running should have the selenium module installed.
版权声明:本文标题:selenium python 入门教程 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686752024a98342.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论