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 ...
分类:
其他好文 时间:
2018-04-11 10:45:36
阅读次数:
158
import requests from bs4 import BeautifulSoup import string import time import datetime import re #获取文章详情 def getNewDetail(newsrrl): #点击次数 def getClic ...
分类:
其他好文 时间:
2018-04-10 21:54:07
阅读次数:
249
原文地址:https://blog.csdn.net/gfd54gd5f46/article/details/54973954 使用Maven 自动下载jar包 右键单击项目,将项目 转换成Maven 项目 然后进去Maven官网 http://mvnrepository.com/ 这里有大量的ja ...
分类:
编程语言 时间:
2018-04-10 19:42:38
阅读次数:
179
import requests from bs4 import BeautifulSoup from datetime import datetime import locale import re locale.setlocale(locale.LC_CTYPE,'chinese') newsur... ...
分类:
其他好文 时间:
2018-04-09 15:01:06
阅读次数:
139
1. 用requests库和BeautifulSoup库,爬取校园新闻首页新闻的标题、链接、正文、show-info。 2. 分析info字符串,获取每篇新闻的发布时间,作者,来源,摄影等信息。 3. 将字符串格式的发布时间转换成datetime类型 4. 使用正则表达式取得新闻编号 5. 生成点击 ...
分类:
其他好文 时间:
2018-04-08 22:44:35
阅读次数:
319
Problem A:Rescue The Princess Description Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the prin ...
分类:
其他好文 时间:
2018-04-08 18:05:10
阅读次数:
172
上篇博客说了正则表达式,但是正则学起来比较费劲,写的时候也不好写,这次说下Beautiful Soup怎么用,这个模块是用来解析html的,它操作很简单,用起来比较方便,比正则学习起来简单多了。 这是第三方模块需要安装 1 2 3 pip install beautifulsoup4 pip ins ...
分类:
其他好文 时间:
2018-04-07 12:52:23
阅读次数:
231
PyQuery模块也是一个解析html的一个模块,它和Beautiful Soup用起来差不多,它是jquery实现的,和jquery语法差不多,会用jquery的人用起来就比较方便了。 Pyquery需要依赖lxml模块,不装的话,使用会报错。 安装 1 2 pip install lxml pi ...
分类:
其他好文 时间:
2018-04-07 12:48:14
阅读次数:
205
参考帖子 https://www.cnblogs.com/Albert-Lee/p/6232745.html https://www.cnblogs.com/twinsclover/archive/2012/04/26/2471704.html ...
分类:
编程语言 时间:
2018-04-06 18:46:26
阅读次数:
132
按照大牛的步骤简单地爬了豆瓣电影top250.过程感想记录一下。 教程链接:在这里 爬虫写完以后,一直出现错误 出错原因:调用对象是个None,然后调用出错。出错行原本是在第10页没有下一页的链接时候,判断soup.find('span', attrs={'class', 'next'}).find ...
分类:
编程语言 时间:
2018-04-05 23:15:14
阅读次数:
299