[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
需要访问过才行。用wget curl 之类的
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

本帖最后由 codegay 于 2016-8-31 17:20 编辑

python 有个selenium库 主要用于web测试
  1. from selenium import webdriver
  2. driver = webdriver.Chrome()
  3. driver.get('https://www.baidu.com/link?url=qjLLUDJLIlOx0TUSg_xpz-Zcjnos1TprMc6_3H0XyXcD0OQD5RSeaPwKMtkzDUC1_G2uXfkzF2bos7uoPclSda&wd=&eqid=be17ee7a0000a04e0000000657c68765')
  4. print (driver.title)
  5. print(driver.current_url)
  6. input("暂停")
  7. driver.quit()
复制代码
输出:
  1. jQuery页面滚动图片等元素动态加载实现 jquery.scrollLoading.js的运用-天云网络
  2. [url]http://www.itiyun.com/jquery-scrollloading-js.html[/url]
复制代码
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

回复 11# happy886rr


    python3.4
装个chromedriver
添加到path
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

回复 11# happy886rr


    同类的工具还有 ghost.py

安装pyqt4
然后pip install ghost.py
https://github.com/jeanphix/Ghost.py
  1. from ghost import Ghost
  2. ghost = Ghost()
  3. with ghost.start() as session:
  4.     page, extra_resources = session.open("http://jeanphix.me")
  5.     assert page.http_status == 200 and 'jeanphix' in page.content
复制代码
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

phantomjs 你也装一下看看。
之前文档上没说要装这个,我也没装,结果我from selenium.webdriver import PhantomJS
也不用了。

http://phantomjs.org/download.html
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

回复 14# happy886rr


    ghost.py似乎是后台执行的吧,好像不需要浏览器。
selenium 下面的webdriver 之类的功能是利用chrome作为容器执行网页代码的。所以必须要有。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

返回列表