推荐星级:
  • 1
  • 2
  • 3
  • 4
  • 5

基于Python的微博爬虫系统研究

更新时间:2019-12-25 10:57:29 大小:2M 上传用户:songhuahua查看TA发布的资源 标签:python微博爬虫系统 下载积分:1分 评价赚积分 (如何评价?) 收藏 评论(0) 举报

资料介绍

随着大数据时代到来,爬虫的需求呈爆炸式增长,以新浪微博为代表的一系列社交应用蕴含着巨大的数据资源。以新浪微博为研究对象,利用Python语言实现模拟登陆和网页解析技术,将获取的用户信息存为文档进行分析。文章分析了新浪微博模拟登陆时的加密方法,研究了验证码识别的实现方法,对挖掘的数据使用TF-IDF算法进行分析,提出了新的微博数据挖掘方向,论述了爬虫的国内外研究现状及开发难题。


部分文件列表

文件名 大小
基于Python的微博爬虫系统研究.pdf 2M

部分页面预览

(完整内容请下载后查看)
总第 19 216 期  
2017 8 月  
大 众 科 技  
Popular Science & Technology  
Vol.19 No.8  
August 2017  
基于 Python的微博爬虫系统研究  
陈政伊 袁云静 贺月锦 武瑞轩  
航天学院信息技术学院,河北 廊坊 065000)  
【摘 要随着大数据时代爬虫需求爆炸增长浪微博为表的一系社交应用蕴含大的数据资源。  
浪微博为研究Python 语言实现模拟登陆网页技术将获取用户信息为文进行分析。文章分析新  
浪微博模拟登陆时的加研究了验证码识别实现挖掘的数据使TF-IDF 进行分析出了数据  
挖掘爬虫的国内外研究现。  
【关键词】大数据浪微博;数据挖掘;Python 爬虫;模拟登陆  
【中图分类号】TP393  
【文献标识码】A  
【文章编号】1008-1151(2017)08-0008-04  
Python-based analysis of Microblog data mining  
Abstract:With the coming of the age of Big Data,the need of Crawler growing explosively.The Social Network are influencing  
everyones life,The Sina Microblog represented by a series of social application containing a large number of data resources.The Sina  
Microblog is the main study object,taking advantage of Python to realize the simulated landing and web page parsing,saving the  
downloaded data to analyze.The prode into the encode method during the simulated landing and how to realize the technology of  
recognizing the verified code,then making use of TF-IDF to further analyze the mined data.Putting forward the new direction of Sina  
Microblog data mining,discussing the research status of Crawler and the problems in the exploit process.  
Key words:Big Data;Sina Microblog;data mining;Python crawler;simulated landing  
文主爬虫解  
1 引言  
、数据分析、数据整合等方面。  
2009 8 公众的  
爬虫计进破解分析,同时  
2016 2016 博月人数已3 亿微  
了如何解分析的数据。  
已成为年人生的一部分大信息意  
2 爬虫研究现状与难题  
但是网络社区Facebook,  
Twitter 的供使用的数据接口  
网络爬虫种按规则自动信  
不成数据分析工作来了力。因此多  
息的程序本,学习和数据挖掘中,爬虫是最基  
技术成科研团队爬虫系统取研数据,同  
经有虫框如  
时,安全考虑技术。而爬虫技术  
Crawler4jWebMagicWebCollectorScrapyNutch 等。  
就是,多数时,有价值的信息一了  
爬虫重要的有方面问题:  
措施防火墙访限制……。  
1德风险爬虫抓网络信息是  
作为一个重分析了码  
的,这些信息侵害不  
的方。  
合法目前我国关网络信息安全方面的规  
Python 作为一个程序爬虫开  
几乎。  
在模浏览行为时,  
2访度限制爬虫于服务器  
Python JavaC#C++洁抓接口模  
带带客户的入以及的质另  
session/cookie 存储和设时,Python 提供第  
,大部分使用大的站都爬虫机制中  
方包Requests在进网页理工作时,  
最基本的就是限制,通访,  
Python 提供的 BeautifulSoup 的代成过滤  
使用一、可用的 IP 机制。  
html ,提本的工作。  
【收稿日期】2017-07-03  
【作者简介】政伊航天学院信息技术学院学生,研究向为数据挖掘web ,机。  
- 8 -  
3
)验的作用人和人。  
发展至  
Google reCAPTCHA 学习理为发的验  
。  
request.pwencode="wsse";  
password=sinaSSOEncoder.hex_sha1(""+sinaSSOEncoder.h  
ex_sha1(sinaSSOEncoder.hex_sha1(password))+me.servertime+  
爬虫[4]  
3 爬虫开发与研究内容  
3.1 拟登陆  
me.nonce)  
request.sp=password;”  
3.1.3 验证码识别  
爬虫发的一个难点两  
安全客户GET 时,  
客户同时发一个用于GET 回  
项目通过发一款爬虫爬虫、  
、数据分析、数据整合等方面。  
的通行较之PC 具  
有代通行入时,要经三  
一个 pin.php  
使用 PyTesser 这个 python 符识,这一个结  
Tesseract OCR 使用的一个证  
程序。  
spliturl 筛选得到url  
url 一个.png .image 。  
个过1:  
使用 requests 载验使用 pytesser 识  
code GET pcid POSTDATA  
数据。  
1
微博拟登陆过程图  
据用入的用username 经过 base64 算法加  
得到su  
su 得到一个 json 中包rsakv  
servername nonce pcid 数  
pubkey,  
密码RSA 算法加得到sp json  
POST 求  
2
拟登陆成功图  
3.1.1 用户名加密  
ssologin.js 到关于用。  
var username=config.username||"";  
username=sinaSSOEncoder.base64.encode(urlencode(usern  
ame));  
3.2 网页下载器  
博博根  
分析url
gaoliaoran?is_search=0&visible=0&is_tag=0&profile_ftype=1&  
page=1#feedtop
spr_qdhz_bd_360ss_weibo_mr&is_hot=1userid  
博博的用入用userid爬虫  
网页后将提供网页  
。  
delete config.username;  
var arrQuery={  
entry:me.entry,callback:me.name+".preloginCallBack",su:us  
ername,rsakt:"mod"};  
3.1.2 密码加密  
3.3 网页解析器  
密码相关ssologin.js 面的中  
loginType rsa 时,客户密码经过 rsa2 算法进行  
建一个 rsa pubkey  
10001pubkeyGET 10001  
js 中的大多数情况新浪登时使用种  
。  
request.pwencode="rsa2";  
项目网页用的beautifulsoup 数据,  
使用 html 作为使用 lxml 作为所  
能相对大。  
据已下html 件定一个 beautifulsoup 象  
soup成一个 html 网页  
中的辨  
通过 soup 象即这些,  
并得到中的,本项目该内要包括博  
以及他原文等。  
request.rsakv=me.rsakv;  
var RSAKey=new sinaSSOEncoder.RSAKey();  
RSAKey.setPublic(me.rsaPubkey,"10001");  
password=RSAKey.encrypt([me.servertime,me.nonce].join(  
数据提程图描述图  
3 所示:  
"\t")+"\n"+password)”  
loginType  
wsse 时,客户密码经过 wsse 算法  
- 9 -  

全部评论(0)

暂无评论