今天看了下自然语言处理的算法textRank如何用python jieba库实现,然后就是一个数据分析过后的展示,可以用词云,echarts,three.js等。现在对自然语言方面感觉还是挺懵的,准备找几本书看吧,补补基础先。
下午收集网络科技热词2019到2015年的
用python从百度百科爬取词性是人物类的名词数据
遇到的问题:爬取数据时出现乱码问题
解决方案:加上这句话:response.encoding = response.apparent_encoding(原因:encoding与apparent_encoding不一样的情况)
一次设置多个网址
解决方案:urls = ['https://baike.baidu.com/item/{}'.format(i) for i in edges]
预编译python代码提示出现乱码问题
解决方案:在开头添加#_*_coding:utf-8_*_
写爬虫代码最麻烦的地方其实是在找规律的环节,基本上都是看自己怎么观察的,没有太多的总结。
爬取结果