WebDriver Plus.
项目描述
使用Python Selenium最简单、最强大的方式
WebDriver Plus是Selenium WebDriver Python绑定的扩展,它为您提供了更简洁、更易于表达的应用程序接口。
它帮助您快速编写可读性高、健壮的测试。
WebDriver Plus有什么优点?
支持池化和自动退出的浏览器实例。
用于查找元素的简洁API,以及广泛的选择器。
使用JQuery风格的遍历和过滤定位元素,无需使用复杂的xpath表达式。
在不使用ActionChains的情况下对元素执行操作。
元素高亮显示使得在Python控制台中进行工作变得愉快。
注意:如果您有兴趣长期维护WebDriver Plus,请与我们联系。目前,作者的多数开源时间都致力于Django REST框架的开发。
入门指南
使用pip安装webdriverplus。
pip安装webdriverplus
现在启动您的Python控制台…
>>> from webdriverplus import WebDriver >>> browser = WebDriver().get('http://www.google.com')
好的,让我们进行搜索。
>>> browser.find(name='q').send_keys('selenium\n')
现在让我们获取所有搜索结果的大纲。
>>> browser.find(id='search').find('h3') WebElementSet( <h3 class="r"><a href="http://seleniumhq.org/" class="l" onmousedown="retur... <h3 class="r"><a href="http://www.google.co.uk/url?sa=t&rct=j&q=sel... <h3 class="r"><a href="http://en.wikipedia.org/wiki/Selenium" class="l" onm... <h3 class="r"><a href="http://en.wikipedia.org/wiki/Selenium_%28software%29... <h3 class="r"><a href="http://ods.od.nih.gov/factsheets/selenium" class="l"... <h3 class="r"><a href="http://www.nlm.nih.gov/medlineplus/druginfo/natural/... <h3 class="r"><a href="http://www.hollandandbarrett.com/selenium-050" class... <h3 class="r"><a href="http://www.whfoods.com/genpage.php?dbid=95&tname... <h3 class="r"><a href="http://www.patient.co.uk/doctor/Selenium.htm" class=... <h3 class="r"><a href="/search?q=selenium&hl=en&biw=940&bih=938... <h3 class="r"><a href="http://www.umm.edu/altmed/articles/selenium-000325.h... )
请注意,WebDriver Plus 已经为您突出显示了所选元素,这对于您编写测试并确保选择正确的元素非常有帮助。
下一步
准备好开始时,请访问完整文档(http://webdriver-plus.readthedocs.org/)。
如果您想为项目做出贡献,请阅读贡献指南(http://webdriver-plus.readthedocs.org/en/latest/topics/contributing.html)
项目详情
关闭
webdriverplus-0.1.5.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 6ea27491a7be23239264423ee1291dedd2bba012c6997a1e751783f6e2794a69 |
|
MD5 | a53f83d35f3d62cec9eba0ac53a1b1ac |
|
BLAKE2b-256 | c9c779bd5ac0d8da44423649bc59561491579b5cf418f21459ea524492a98ff4 |