一、Beautiful Soup 库的安装 Win平台:“以管理员身份运行” cmd 执行 pip install beautifulsoup4 安装小测:from bs4 import BeautifulSoup soup=BeautifulSoup('<p>data</p>','html.par ...
分类:
编程语言 时间:
2018-01-08 01:08:16
阅读次数:
198
BeautifulSoup中可以通过name和attrs去定位名称和属性,以找到特定的html代码。更值得称赞的是,attrs支持正则表达式。 如: <div class="cool"> <h1 class="abc">design</h1> </div> 搜索此行,可以这样写 abcSoup = ...
分类:
编程语言 时间:
2018-01-07 20:16:04
阅读次数:
284
1 参考博客: http://blog.csdn.net/SVALBARDKSY/article/details/50548073 2 准备工作 1. 环境 2.准备工作 3.定义Model .admin注册 4. 构建DB 5.然后同步数据结构,默认使用Sqlite3. 6.admi后台 3 使用 ...
最近一直在关注Python写爬虫相关的知识,尝试了采用requests+BeautifulSoup来爬取房天下(原搜房网)的推荐新楼盘。不用不知道,一用发现有惊喜也有惊吓,本文就一同记录下惊喜和踩的一些乱码的坑。首先,觉得Beautifulsoup解析网页更加符合人类的常规思维,比使用正则表达式(python中的re库)更容易理解。同时关于requests遇到了中文字符和特殊字符解码的问题。本文都
分类:
编程语言 时间:
2018-01-07 14:08:32
阅读次数:
182
爬虫的操作步骤: 爬虫三步走 爬虫第一步:使用requests获得数据: 1.导入requests 2.使用requests.get获取网页源码 import requests r = requests.get('https://book.douban.com/subject/1084336/com ...
分类:
编程语言 时间:
2018-01-02 16:54:43
阅读次数:
186
import timeimport requestsfrom bs4 import BeautifulSoupimport threadingdef format_str(s): return s.replace("\n","").replace("","").replace("\t",'')def ...
分类:
编程语言 时间:
2017-12-31 11:56:36
阅读次数:
140
学习+兴趣结合联系爬取图片(感觉还行,就是有点慢,135张图片花了37秒,改天用多线程试试): ...
分类:
编程语言 时间:
2017-12-26 00:47:09
阅读次数:
169
Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requ ...
分类:
其他好文 时间:
2017-12-24 11:27:02
阅读次数:
137
Excuse me --1. 对不起,打扰了 --2. 借过一下,让一让 --3. 失陪了 --4. 麻烦再说一遍 简单句: 1. 主+谓 2. 主+谓+宾 3. 主+谓+宾+宾 4. 主+谓+宾+宾补 5. 主+系+表 I love you. she is beautiful. 主格:I,you, ...
分类:
其他好文 时间:
2017-12-23 12:07:35
阅读次数:
154
1.Better WPF Circular Progress Bar 2.Bending the WPF ProgressBar 3.A CIRCULAR PROGRESSBAR STYLE USING AN ATTACHED VIEWMODEL ...