#!/usr/bin/env python # -*- coding: utf-8 -*- ''' @Auther :liuyuqi.gov@msn.cn @Time :2018/4/11 15:31 @File :test-phantomjs.py ''' from splinter import Browser browser=Browser("phantomjs",executable_path="D:/Program-Files/phantomjs-2.1.1-windows/bin/phantomjs.exe") url="http://blog.yoqi.me/archives/4395" browser.visit(url=url) # browser.find_by_xpath() # browser.find_by_css() # browser.find_by_id() # browser.find_link_by_text() # browser.fill("q","splinter - python acceptance testing for web applications") # button=browser.find_by_name("btnG") # button.click() browser.driver.set_window_size(1366, 768) print("页面标题",browser.title)