资源简介


资源截图

代码片段和文件信息

#coding:utf-8  
from selenium import webdriver  
from selenium.webdriver.support.ui import WebDriverWait   # WebDriverWait的作用是等待某个条件的满足之后再往后运行  
import time  
import sys  
driver = webdriver.PhantomJS(executable_path=r‘D:\Projects\PythonProjects\PythonApplication1\PythonApplication1\phantomjs-2.1.1-windows\bin\phantomjs.exe‘)  # 构造网页驱动  
  
driver.get(‘http://www.yingxiaobu.com/forum.php‘)       # 打开网页  
driver.find_element_by_xpath(‘//*[@id=“ls_username“]‘).send_keys(‘你的用户名‘)  
driver.find_element_by_xpath(‘//*[@id=“ls_password“]‘).send_keys(‘你的密码‘)  
#driver.get_screenshot_as_file(‘验证码.jpg‘)                   # 截取当前页面的图片  
#input_solution = input(‘请输入验证码 :‘)  手工打码  
#driver.find_element_by_xpath(‘//input[@name=“captcha“]‘).send_keys(input_solution)  
#time.sleep(2)  
  
dr

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1767  2018-06-08 22:30  PythonApplication1.py
     目录           0  2018-06-08 21:57  phantomjs-2.1.1-windows\
     文件       17204  2016-01-24 16:41  phantomjs-2.1.1-windows\ChangeLog
     文件        1429  2016-01-24 16:41  phantomjs-2.1.1-windows\LICENSE.BSD
     文件        2502  2016-01-24 16:41  phantomjs-2.1.1-windows\README.md
     目录           0  2018-06-08 21:57  phantomjs-2.1.1-windows\bin\
     文件    18587648  2016-01-25 06:21  phantomjs-2.1.1-windows\bin\phantomjs.exe
     目录           0  2018-06-08 21:57  phantomjs-2.1.1-windows\examples\
     文件         267  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\arguments.js
     文件         686  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\child_process-examples.js
     文件        1671  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\colorwheel.js
     文件         226  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\countdown.js
     文件        1774  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\detectsniff.js
     文件         601  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\echoToFile.js
     文件         806  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\features.js
     文件         286  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\fibo.js
     文件          60  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\hello.js
     文件         865  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\injectme.js
     文件         674  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\loadspeed.js
     文件         715  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\loadurlwithoutcss.js
     文件       51351  2015-10-07 04:05  phantomjs-2.1.1-windows\examples\modernizr.js
     文件         135  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\module.js
     文件         671  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\netlog.js
     文件        4228  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\netsniff.js
     文件         779  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\openurlwithproxy.js
     文件         392  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\outputEncoding.js
     文件        4521  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\page_events.js
     文件         623  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\pagecallback.js
     文件         622  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\phantomwebintro.js
     文件         394  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\post.js
     文件         472  2016-01-24 17:22  phantomjs-2.1.1-windows\examples\postjson.js
............此处省略24个文件信息

评论

共有 条评论