12 2015 档案

摘要:以下代码在 python 3.5 + jupyter notebook 中运行测试无误!# 我们爬取网页的目的,无非是先定位到DOM树的节点,然后取其文本或属性值myPage = ''' TITLE 我的博客 我的文章 ... 阅读全文
posted @ 2015-12-27 07:16 罗兵 阅读(39330) 评论(0) 推荐(7) 编辑
摘要:【原文地址:】http://python.jobbole.com/83588/import requestsfrom lxml import html# 创建 session 对象。这个对象会保存所有的登录会话请求。session_requests = requests.session()# 提取在... 阅读全文
posted @ 2015-12-22 18:08 罗兵 阅读(11154) 评论(0) 推荐(1) 编辑
摘要:一、多线程import threadingfrom time import ctime,sleepdef music(func): for i in range(2): print("I was listening to %s. %s" %(func,ctime())) ... 阅读全文
posted @ 2015-12-17 03:27 罗兵 阅读(627) 评论(1) 推荐(0) 编辑
摘要:'''得到当前页面所有连接'''import requestsimport refrom bs4 import BeautifulSoupfrom lxml import etreefrom selenium import webdriverurl = 'http://www.ok226.com'r... 阅读全文
posted @ 2015-12-14 03:15 罗兵 阅读(12236) 评论(4) 推荐(3) 编辑

点击右上角即可分享
微信分享提示