splinter(python操作浏览器魔魁啊)

from splinter import Browser

def main():
browser = Browser()
browser.visit('http://google.com')
browser.fill('q', 'splinter - python acceptance testing for web applications')
button = browser.find_by_name('btnK')
button.click()

if browser.is_text_present('splinter.cobrateam.info'):
print 'yes, the official website was found!'
else:
print "No, it wasn't found... We need o improve our SEO techniques"


browser.quit()

if __name__ == '__main__':
main()

开源学习,互动进步
原文地址:https://www.cnblogs.com/L0VEGP/p/5492032.html