资源简介

python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词python分词

资源截图

代码片段和文件信息

# -*- coding:utf-8 -*-
import sysospdbretimerandomdatetime
from spider import SpiderHTML
from bs4 import BeautifulSoup

class QiubaiSpider(SpiderHTML):
def __init__(selfcontentTypepageStart=1 pageEnd=1):
#super.__init__(self)
self._contentType = contentType
self._pageStart = int(pageStart)
self._pageEnd = int(pageEnd)+1
self.__url = {‘new‘:‘http://www.qiushibaike.com/textnew/page/‘‘hot‘:‘http://www.qiushibaike.com/text/page/‘}

def getJokes(self):
reqUrl = ‘‘

if contentType in self.__url:
reqUrl = self.__url[self._contentType]
else:
reqUrl = self.__url[‘new‘]
for i in range(self._pageStartself._pageEnd):
pageUrl = reqUrl+str(i)+‘/‘
jokes = self.getUrl(pageUrl)
jokes = jokes.find_all(‘div‘id=re.compile(‘qiushi_tag_\d+‘))
filepath = os.path.

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-03-09 09:24  Pythonspider-master\
     文件         711  2017-03-09 09:24  Pythonspider-master\README.md
     目录           0  2017-03-09 09:24  Pythonspider-master\bili_online\
     文件         422  2017-03-09 09:24  Pythonspider-master\bili_online\README.MD
     文件         955  2017-03-09 09:24  Pythonspider-master\bili_online\biliOnline.py
     文件         723  2017-03-09 09:24  Pythonspider-master\bili_online\bili_online.sql
     文件         501  2017-03-09 09:24  Pythonspider-master\bili_online\data.php
     文件        2393  2017-03-09 09:24  Pythonspider-master\bili_online\show.html
     目录           0  2017-03-09 09:24  Pythonspider-master\bilibili\
     文件         699  2017-03-09 09:24  Pythonspider-master\bilibili\README.MD
     文件        6594  2017-03-09 09:24  Pythonspider-master\bilibili\bilibili.py
     文件        1382  2017-03-09 09:24  Pythonspider-master\bilibili\bilibili.sql
     文件        1196  2017-03-09 09:24  Pythonspider-master\bilibili\bilidata.php
     文件        4905  2017-03-09 09:24  Pythonspider-master\bilibili\show.html
     目录           0  2017-03-09 09:24  Pythonspider-master\image\
     文件       63819  2017-03-09 09:24  Pythonspider-master\image\1.png
     文件       56877  2017-03-09 09:24  Pythonspider-master\image\online.png
     文件        2380  2017-03-09 09:24  Pythonspider-master\qiubai.py
     文件        1269  2017-03-09 09:24  Pythonspider-master\spider.py
     文件        2748  2017-03-09 09:24  Pythonspider-master\taobaomm.py
     文件        4182  2017-03-09 09:24  Pythonspider-master\zhihu.py

评论

共有 条评论