<p>如果您想自动化web任务,请查看<a href="http://selenium-python.readthedocs.io/getting-started.html" rel="nofollow">selenium</a></p>
<blockquote>
<p>Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. Through Selenium Python API you can access all functionalities of Selenium WebDriver in an intuitive way.</p>
</blockquote>
<p>seleniumpython绑定提供了一个方便的API来访问seleniumwebdrivers,如Firefox、Ie、Chrome、Remote等</p>
<p>这里有一个链接到什么是<a href="http://www.seleniumhq.org/docs/01_introducing_selenium.jsp" rel="nofollow">selenium and webdrivers</a></p>
<p>看你能不能做到:</p>
<pre><code>from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("http://www.python.org")
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()
</code></pre>
<p>见<a href="http://selenium-python.readthedocs.io/getting-started.html#example-explained" rel="nofollow">here for a breakdown of the code</a></p>
<p>对于消息示例,可以使用<a href="https://pypi.python.org/pypi/Skype4Py/" rel="nofollow">Skype4Py API</a></p>