今天来跟大家分享一下从数据可视化角度看扫黑风暴~

  • 绪论

  • 如何查找视频id

  • 项目结构

    • 制作词云图

    • 制作最近评论数条形图与折线图

    • 制作每小时评论条形图与折线图

    • 制作最近评论数饼图

    • 制作每小时评论饼图

    • 制作观看时间区间评论统计饼图

    • 制作扫黑风暴主演提及占比饼图

    • 制作评论内容情感分析图

    • 评论的时间戳转换为正常时间

    • 评论内容读入CSV

    • 统计一天各个时间段内的评论数

    • 统计最近评论数

    • 爬取评论内容

    • 爬取评论时间

    • 一.爬虫部分

    • 二.数据处理部分

    • 三. 数据分析

绪论

本期是对腾讯热播剧——扫黑风暴的一次爬虫与数据分析,耗时两个小时,总爬取条数3W条评论,总体来说比较普通,值得注意的一点是评论的情绪文本分析处理,这是第一次接触的知识。

爬虫方面:由于腾讯的评论数据是封装在json里面,所以只需要找到json文件,对需要的数据进行提取保存即可。

  • 视频网址:https://v.qq.com/x/cover/mzc00200lxzhhqz.html

  • 评论json数据网址:https://video.coral.qq.com/varticle/7225749902/comment/v2

  • 注:只要替换视频数字id的值,即可爬取其他视频的评论

如何查找视频id?

项目结构:

一. 爬虫部分:

1.爬取评论内容代码:spiders.py

import requests
import re
import randomdef get_html(url, params):uapools = ['Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36','Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14']thisua = random.choice(uapools)headers = {"User-Agent": thisua}r = requests.get(url, headers=headers, params=params)r.raise_for_status()r.encoding = r.apparent_encodingr.encoding = 'utf-8'  # 不加此句出现乱码return r.textdef parse_page(infolist, data):commentpat = '"content":"(.*?)"'lastpat = '"last":"(.*?)"'commentall = re.compile(commentpat, re.S).findall(data)next_cid = re.compile(lastpat).findall(data)[0]infolist.append(commentall)return next_ciddef print_comment_list(infolist):j = 0for page in infolist:print('第' + str(j + 1) + '页\n')commentall = pagefor i in range(0, len(commentall)):print(commentall[i] + '\n')j += 1def save_to_txt(infolist, path):fw = open(path, 'w+', encoding='utf-8')j = 0for page in infolist:#fw.write('第' + str(j + 1) + '页\n')commentall = pagefor i in range(0, len(commentall)):fw.write(commentall[i] + '\n')j += 1fw.close()def main():infolist = []vid = '7225749902';cid = "0";page_num = 3000url = 'https://video.coral.qq.com/varticle/' + vid + '/comment/v2'#print(url)for i in range(page_num):params = {'orinum': '10', 'cursor': cid}html = get_html(url, params)cid = parse_page(infolist, html)print_comment_list(infolist)save_to_txt(infolist, 'content.txt')main()

2.爬取评论时间代码:sp.py

import requests
import re
import randomdef get_html(url, params):uapools = ['Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36','Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14']thisua = random.choice(uapools)headers = {"User-Agent": thisua}r = requests.get(url, headers=headers, params=params)r.raise_for_status()r.encoding = r.apparent_encodingr.encoding = 'utf-8'  # 不加此句出现乱码return r.textdef parse_page(infolist, data):commentpat = '"time":"(.*?)"'lastpat = '"last":"(.*?)"'commentall = re.compile(commentpat, re.S).findall(data)next_cid = re.compile(lastpat).findall(data)[0]infolist.append(commentall)return next_ciddef print_comment_list(infolist):j = 0for page in infolist:print('第' + str(j + 1) + '页\n')commentall = pagefor i in range(0, len(commentall)):print(commentall[i] + '\n')j += 1def save_to_txt(infolist, path):fw = open(path, 'w+', encoding='utf-8')j = 0for page in infolist:#fw.write('第' + str(j + 1) + '页\n')commentall = pagefor i in range(0, len(commentall)):fw.write(commentall[i] + '\n')j += 1fw.close()def main():infolist = []vid = '7225749902';cid = "0";page_num =3000url = 'https://video.coral.qq.com/varticle/' + vid + '/comment/v2'#print(url)for i in range(page_num):params = {'orinum': '10', 'cursor': cid}html = get_html(url, params)cid = parse_page(infolist, html)print_comment_list(infolist)save_to_txt(infolist, 'time.txt')main()

二.数据处理部分

1.评论的时间戳转换为正常时间 time.py

# coding=gbk
import csv
import timecsvFile = open("data.csv",'w',newline='',encoding='utf-8')
writer = csv.writer(csvFile)
csvRow = []
#print(csvRow)
f = open("time.txt",'r',encoding='utf-8')
for line in f:csvRow = int(line)#print(csvRow)timeArray = time.localtime(csvRow)csvRow = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)print(csvRow)csvRow = csvRow.split()writer.writerow(csvRow)f.close()
csvFile.close()


2.评论内容读入csv  CD.py

# coding=gbk
import csv
csvFile = open("content.csv",'w',newline='',encoding='utf-8')
writer = csv.writer(csvFile)
csvRow = []f = open("content.txt",'r',encoding='utf-8')
for line in f:csvRow = line.split()writer.writerow(csvRow)f.close()
csvFile.close()

3.统计一天各个时间段内的评论数 py.py

# coding=gbk
import csvfrom pyecharts import options as opts
from sympy.combinatorics import Subset
from wordcloud import WordCloudwith open('../Spiders/data.csv') as csvfile:reader = csv.reader(csvfile)data1 = [str(row[1])[0:2] for row in reader]print(data1)
print(type(data1))#先变成集合得到seq中的所有元素,避免重复遍历
set_seq = set(data1)
rst = []
for item in set_seq:rst.append((item,data1.count(item)))  #添加元素及出现个数
rst.sort()
print(type(rst))
print(rst)with open("time2.csv", "w+", newline='', encoding='utf-8') as f:writer = csv.writer(f, delimiter=',')for i in rst:                # 对于每一行的,将这一行的每个元素分别写在对应的列中writer.writerow(i)with open('time2.csv') as csvfile:reader = csv.reader(csvfile)x = [str(row[0]) for row in reader]print(x)
with open('time2.csv') as csvfile:reader = csv.reader(csvfile)y1 = [float(row[1]) for row in reader]print(y1)

处理结果(评论时间,评论数)

4.统计最近评论数 py1.py

# coding=gbk
import csvfrom pyecharts import options as opts
from sympy.combinatorics import Subset
from wordcloud import WordCloudwith open('../Spiders/data.csv') as csvfile:reader = csv.reader(csvfile)data1 = [str(row[0]) for row in reader]#print(data1)
print(type(data1))#先变成集合得到seq中的所有元素,避免重复遍历
set_seq = set(data1)
rst = []
for item in set_seq:rst.append((item,data1.count(item)))  #添加元素及出现个数
rst.sort()
print(type(rst))
print(rst)with open("time1.csv", "w+", newline='', encoding='utf-8') as f:writer = csv.writer(f, delimiter=',')for i in rst:                # 对于每一行的,将这一行的每个元素分别写在对应的列中writer.writerow(i)with open('time1.csv') as csvfile:reader = csv.reader(csvfile)x = [str(row[0]) for row in reader]print(x)
with open('time1.csv') as csvfile:reader = csv.reader(csvfile)y1 = [float(row[1]) for row in reader]print(y1)

处理结果(评论时间,评论数)

三. 数据分析

数据分析方面:涉及到了词云图,条形,折线,饼图,后三者是对评论时间与主演占比的分析,然而腾讯的评论时间是以时间戳的形式显示,所以要进行转换,再去统计出现次数,最后,新加了对评论内容的情感分析。

1.制作词云图

wc.py

import numpy as np
import re
import jieba
from wordcloud import WordCloud
from matplotlib import pyplot as plt
from PIL import Image# 上面的包自己安装,不会的就百度f = open('../Spiders/content.txt', 'r', encoding='utf-8')  # 这是数据源,也就是想生成词云的数据
txt = f.read()  # 读取文件
f.close()  # 关闭文件,其实用with就好,但是懒得改了
# 如果是文章的话,需要用到jieba分词,分完之后也可以自己处理下再生成词云
newtxt = re.sub("[A-Za-z0-9\!\%\[\]\,\。]", "", txt)
print(newtxt)
words = jieba.lcut(newtxt)img = Image.open(r'wc.jpg')  # 想要搞得形状
img_array = np.array(img)# 相关配置,里面这个collocations配置可以避免重复
wordcloud = WordCloud(background_color="white",width=1080,height=960,font_path="../文悦新青年.otf",max_words=150,scale=10,#清晰度max_font_size=100,mask=img_array,collocations=False).generate(newtxt)plt.imshow(wordcloud)
plt.axis('off')
plt.show()
wordcloud.to_file('wc.png')

轮廓图:wc.jpg

词云图:result.png(注:这里要把英文字母过滤掉)

2.制作最近评论数条形图与折线图  DrawBar.py

# encoding: utf-8
import csv
import pyecharts.options as opts
from pyecharts.charts import Bar
from pyecharts.globals import ThemeTypeclass DrawBar(object):"""绘制柱形图类"""def __init__(self):"""创建柱状图实例,并设置宽高和风格"""self.bar = Bar(init_opts=opts.InitOpts(width='1500px', height='700px', theme=ThemeType.LIGHT))def add_x(self):"""为图形添加X轴数据"""with open('time1.csv') as csvfile:reader = csv.reader(csvfile)x = [str(row[0]) for row in reader]print(x)self.bar.add_xaxis(xaxis_data=x,)def add_y(self):with open('time1.csv') as csvfile:reader = csv.reader(csvfile)y1 = [float(row[1]) for row in reader]print(y1)"""为图形添加Y轴数据,可添加多条"""self.bar.add_yaxis(  # 第一个Y轴数据series_name="评论数",  # Y轴数据名称y_axis=y1,  # Y轴数据label_opts=opts.LabelOpts(is_show=True,color="black"),  # 设置标签bar_max_width='100px',  # 设置柱子最大宽度)def set_global(self):"""设置图形的全局属性"""#self.bar(width=2000,height=1000)self.bar.set_global_opts(title_opts=opts.TitleOpts(  # 设置标题title='扫黑风暴近日评论统计',title_textstyle_opts=opts.TextStyleOpts(font_size=35)),tooltip_opts=opts.TooltipOpts(  # 提示框配置项(鼠标移到图形上时显示的东西)is_show=True,  # 是否显示提示框trigger="axis",  # 触发类型(axis坐标轴触发,鼠标移到时会有一条垂直于X轴的实线跟随鼠标移动,并显示提示信息)axis_pointer_type="cross"  # 指示器类型(cross将会生成两条分别垂直于X轴和Y轴的虚线,不启用trigger才会显示完全)),toolbox_opts=opts.ToolboxOpts(),  # 工具箱配置项(什么都不填默认开启所有工具))def draw(self):"""绘制图形"""self.add_x()self.add_y()self.set_global()self.bar.render('../Html/DrawBar.html')  # 将图绘制到 test.html 文件内,可在浏览器打开def run(self):"""执行函数"""self.draw()if __name__ == '__main__':app = DrawBar()app.run()

效果图:DrawBar.html

3.制作每小时评论条形图与折线图  DrawBar2.py

# encoding: utf-8
# encoding: utf-8
import csv
import pyecharts.options as opts
from pyecharts.charts import Bar
from pyecharts.globals import ThemeTypeclass DrawBar(object):"""绘制柱形图类"""def __init__(self):"""创建柱状图实例,并设置宽高和风格"""self.bar = Bar(init_opts=opts.InitOpts(width='1500px', height='700px', theme=ThemeType.MACARONS))def add_x(self):"""为图形添加X轴数据"""str_name1 = '点'with open('time2.csv') as csvfile:reader = csv.reader(csvfile)x = [str(row[0] + str_name1) for row in reader]print(x)self.bar.add_xaxis(xaxis_data=x)def add_y(self):with open('time2.csv') as csvfile:reader = csv.reader(csvfile)y1 = [int(row[1]) for row in reader]print(y1)"""为图形添加Y轴数据,可添加多条"""self.bar.add_yaxis(  # 第一个Y轴数据series_name="评论数",  # Y轴数据名称y_axis=y1,  # Y轴数据label_opts=opts.LabelOpts(is_show=False),  # 设置标签bar_max_width='50px',  # 设置柱子最大宽度)def set_global(self):"""设置图形的全局属性"""#self.bar(width=2000,height=1000)self.bar.set_global_opts(title_opts=opts.TitleOpts(  # 设置标题title='扫黑风暴各时间段评论统计',title_textstyle_opts=opts.TextStyleOpts(font_size=35)),tooltip_opts=opts.TooltipOpts(  # 提示框配置项(鼠标移到图形上时显示的东西)is_show=True,  # 是否显示提示框trigger="axis",  # 触发类型(axis坐标轴触发,鼠标移到时会有一条垂直于X轴的实线跟随鼠标移动,并显示提示信息)axis_pointer_type="cross"  # 指示器类型(cross将会生成两条分别垂直于X轴和Y轴的虚线,不启用trigger才会显示完全)),toolbox_opts=opts.ToolboxOpts(),  # 工具箱配置项(什么都不填默认开启所有工具))def draw(self):"""绘制图形"""self.add_x()self.add_y()self.set_global()self.bar.render('../Html/DrawBar2.html')  # 将图绘制到 test.html 文件内,可在浏览器打开def run(self):"""执行函数"""self.draw()if __name__ == '__main__':app = DrawBar()app.run()

效果图:DrawBar2.html

4.制作最近评论数饼图   pie_pyecharts.py

import csvfrom pyecharts import options as opts
from pyecharts.charts import Pie
from random import randintfrom pyecharts.globals import ThemeTypewith open('time1.csv') as csvfile:reader = csv.reader(csvfile)x = [str(row[0]) for row in reader]print(x)
with open('time1.csv') as csvfile:reader = csv.reader(csvfile)y1 = [float(row[1]) for row in reader]print(y1)num = y1
lab = x
(Pie(init_opts=opts.InitOpts(width='1700px',height='450px',theme=ThemeType.LIGHT))#默认900,600.set_global_opts(title_opts=opts.TitleOpts(title="扫黑风暴近日评论统计",title_textstyle_opts=opts.TextStyleOpts(font_size=27)),legend_opts=opts.LegendOpts(pos_top="10%", pos_left="1%",# 图例位置调整),).add(series_name='',center=[280, 270], data_pair=[(j, i) for i, j in zip(num, lab)])#饼图.add(series_name='',center=[845, 270],data_pair=[(j,i) for i,j in zip(num,lab)],radius=['40%','75%'])#环图.add(series_name='', center=[1380, 270],data_pair=[(j, i) for i, j in zip(num, lab)], rosetype='radius')#南丁格尔图
).render('../Html/pie_pyecharts.html')

效果图

在这里插入图片描述

5.制作每小时评论饼图  pie_pyecharts2.py

import csvfrom pyecharts import options as opts
from pyecharts.charts import Pie
from random import randintfrom pyecharts.globals import ThemeTypestr_name1 = '点'with open('time2.csv') as csvfile:reader = csv.reader(csvfile)x = [str(row[0]+str_name1) for row in reader]print(x)
with open('time2.csv') as csvfile:reader = csv.reader(csvfile)y1 = [int(row[1]) for row in reader]print(y1)num = y1
lab = x
(Pie(init_opts=opts.InitOpts(width='1650px',height='500px',theme=ThemeType.LIGHT,))#默认900,600.set_global_opts(title_opts=opts.TitleOpts(title="扫黑风暴每小时评论统计",title_textstyle_opts=opts.TextStyleOpts(font_size=27)),legend_opts=opts.LegendOpts(pos_top="8%", pos_left="4%",# 图例位置调整),).add(series_name='',center=[250, 300], data_pair=[(j, i) for i, j in zip(num, lab)])#饼图.add(series_name='',center=[810, 300],data_pair=[(j,i) for i,j in zip(num,lab)],radius=['40%','75%'])#环图.add(series_name='', center=[1350, 300],data_pair=[(j, i) for i, j in zip(num, lab)], rosetype='radius')#南丁格尔图
).render('../Html/pie_pyecharts2.html')

效果图

6.制作观看时间区间评论统计饼图  pie_pyecharts3.py

# coding=gbk
import csvfrom pyecharts import options as opts
from pyecharts.globals import ThemeType
from sympy.combinatorics import Subset
from wordcloud import WordCloudwith open('../Spiders/data.csv') as csvfile:reader = csv.reader(csvfile)data2 = [int(row[1].strip('')[0:2]) for row in reader]#print(data2)
print(type(data2))#先变成集合得到seq中的所有元素,避免重复遍历
set_seq = set(data2)
list = []
for item in set_seq:list.append((item,data2.count(item)))  #添加元素及出现个数
list.sort()
print(type(list))
#print(list)with open("time2.csv", "w+", newline='', encoding='utf-8') as f:writer = csv.writer(f, delimiter=',')for i in list:                # 对于每一行的,将这一行的每个元素分别写在对应的列中writer.writerow(i)n = 4 #分成n组
m = int(len(list)/n)
list2 = []
for i in range(0, len(list), m):list2.append(list[i:i+m])print("凌晨 : ",list2[0])
print("上午 : ",list2[1])
print("下午 : ",list2[2])
print("晚上 : ",list2[3])with open('time2.csv') as csvfile:reader = csv.reader(csvfile)y1 = [int(row[1]) for row in reader]print(y1)n =6
groups = [y1[i:i + n] for i in range(0, len(y1), n)]print(groups)x=['凌晨','上午','下午','晚上']
y1=[]
for y1 in groups:num_sum = 0for groups in y1:num_sum += groupsprint(x)
print(y1)import csvfrom pyecharts import options as opts
from pyecharts.charts import Pie
from random import randintstr_name1 = '点'num = y1
lab = x
(Pie(init_opts=opts.InitOpts(width='1500px',height='450px',theme=ThemeType.LIGHT))#默认900,600.set_global_opts(title_opts=opts.TitleOpts(title="扫黑风暴观看时间区间评论统计", title_textstyle_opts=opts.TextStyleOpts(font_size=30)),legend_opts=opts.LegendOpts(pos_top="8%",  # 图例位置调整),).add(series_name='',center=[260, 270], data_pair=[(j, i) for i, j in zip(num, lab)])#饼图.add(series_name='',center=[1230, 270],data_pair=[(j,i) for i,j in zip(num,lab)],radius=['40%','75%'])#环图.add(series_name='', center=[750, 270],data_pair=[(j, i) for i, j in zip(num, lab)], rosetype='radius')#南丁格尔图
).render('../Html/pie_pyecharts3.html')

效果图

7.制作扫黑风暴主演提及占比饼图  pie_pyecharts4.py

import csvimport numpy as np
import re
import jieba
from matplotlib.pyplot import scatter
from wordcloud import WordCloud
from matplotlib import pyplot as plt
from PIL import Image# 上面的包自己安装,不会的就百度f = open('../Spiders/content.txt', 'r', encoding='utf-8')  # 这是数据源,也就是想生成词云的数据
words = f.read()  # 读取文件
f.close()  # 关闭文件,其实用with就好,但是懒得改了name=["孙红雷","张艺兴","刘奕君","吴越","王志飞","刘之冰","江疏影"]print(name)
count=[float(words.count("孙红雷")),float(words.count("艺兴")),float(words.count("刘奕君")),float(words.count("吴越")),float(words.count("王志飞")),float(words.count("刘之冰")),float(words.count("江疏影"))]
print(count)import csvfrom pyecharts import options as opts
from pyecharts.charts import Pie
from random import randintfrom pyecharts.globals import ThemeTypenum = count
lab = name
(Pie(init_opts=opts.InitOpts(width='1650px',height='450px',theme=ThemeType.LIGHT))#默认900,600.set_global_opts(title_opts=opts.TitleOpts(title="扫黑风暴主演提及占比",title_textstyle_opts=opts.TextStyleOpts(font_size=27)),legend_opts=opts.LegendOpts(pos_top="3%", pos_left="33%",# 图例位置调整),).add(series_name='',center=[280, 270], data_pair=[(j, i) for i, j in zip(num, lab)])#饼图.add(series_name='',center=[800, 270],data_pair=[(j,i) for i,j in zip(num,lab)],radius=['40%','75%'])#环图.add(series_name='', center=[1300, 270],data_pair=[(j, i) for i, j in zip(num, lab)], rosetype='radius')#南丁格尔图
).render('../Html/pie_pyecharts4.html')

效果图


8.评论内容情感分析  SnowNLP.py

import numpy as np
from snownlp import SnowNLP
import matplotlib.pyplot as pltf = open('../Spiders/content.txt', 'r', encoding='UTF-8')
list = f.readlines()
sentimentslist = []
for i in list:s = SnowNLP(i)print(s.sentiments)sentimentslist.append(s.sentiments)
plt.hist(sentimentslist, bins=np.arange(0, 1, 0.01), facecolor='g')
plt.xlabel('Sentiments Probability')
plt.ylabel('Quantity')
plt.title('Analysis of Sentiments')
plt.show()

效果图(情感各分数段出现频率)SnowNLP情感分析是基于情感词典实现的,其简单的将文本分为两类,积极和消极,返回值为情绪的概率,也就是情感评分在[0,1]之间,越接近1,情感表现越积极,越接近0,情感表现越消极。

推荐阅读:入门: 最全的零基础学Python的问题  | 零基础学了8个月的Python  | 实战项目 |学Python就是这条捷径干货:爬取豆瓣短评,电影《后来的我们》 | 38年NBA最佳球员分析 |   从万众期待到口碑扑街!唐探3令人失望  | 笑看新倚天屠龙记 | 灯谜答题王 |用Python做个海量小姐姐素描图 |碟中谍这么火,我用机器学习做个迷你推荐系统电影趣味:弹球游戏  | 九宫格  | 漂亮的花 | 两百行Python《天天酷跑》游戏!AI: 会做诗的机器人 | 给图片上色 | 预测收入 | 碟中谍这么火,我用机器学习做个迷你推荐系统电影小工具: Pdf转Word,轻松搞定表格和水印! | 一键把html网页保存为pdf!|  再见PDF提取收费! | 用90行代码打造最强PDF转换器,word、PPT、excel、markdown、html一键转换 | 制作一款钉钉低价机票提示器! |60行代码做了一个语音壁纸切换器天天看小姐姐!|年度爆款文案1).卧槽!Pdf转Word用Python轻松搞定!2).学Python真香!我用100行代码做了个网站,帮人PS旅行图片,赚个鸡腿吃3).首播过亿,火爆全网,我分析了《乘风破浪的姐姐》,发现了这些秘密 4).80行代码!用Python做一个哆来A梦分身 5).你必须掌握的20个python代码,短小精悍,用处无穷 6).30个Python奇淫技巧集 7).我总结的80页《菜鸟学Python精选干货.pdf》,都是干货 8).再见Python!我要学Go了!2500字深度分析!9).发现一个舔狗福利!这个Python爬虫神器太爽了,自动下载妹子图片
点阅读原文,领AI全套资料!

用Python爬取了《扫黑风暴》数据,并将其可视化分析后,终于知道它为什么这么火了~...相关推荐

  1. 【Python】手把手教你用Python爬取某网小说数据,并进行可视化分析

    网络文学是以互联网为展示平台和传播媒介,借助相关互联网手段来表现文学作品及含有一部分文字作品的网络技术产品,在当前成为一种新兴的文学现象,并快速兴起,各种网络小说也是层出不穷,今天我们使用seleni ...

  2. Python爬取微博热搜数据之炫酷可视化

    可视化展示 看完记得点个赞哟 微博炫酷可视化音乐组合版来了! 项目介绍 背景 现阶段,微博.抖音.快手.哗哩哗哩.微信公众号已经成为不少年轻人必备的"生活神器".在21世纪的今天, ...

  3. 通过Python爬取QQ空间说说并通过Pyechart进行可视化分析

    有一天我突然发现自己空间的说说竟然已经达到1833条,于是萌生了爬一下看看的想法(其实就是想学下python爬虫).我找了一些博客,方法不少,但是有些并不适用.所以我把真正能用的方法记录下来,并且爬取 ...

  4. Python爬取《扫黑风暴》腾讯视频弹幕

    关键是找到弹幕的URL 等待,广告完成,按下F12 在Ctrl+R刷新 代码如下 #-*- coding = uft-8 -*- #@Time : 2020/9/26 4:35 下午 #@Author ...

  5. python实战|python爬取58同城租房数据并以Excel文件格式保存到本地

    python实战|python爬取58同城租房数据并以Excel文件格式保存到本地 一.分析目标网站url 目标网站:https://cq.58.com/minsuduanzu/ 让我们看看网站长啥样 ...

  6. python爬取微博热搜数据并保存!

    主要用到requests和bf4两个库将获得的信息保存在d://hotsearch.txt下importrequests;importbs4mylist=[]r=requests.get(ur- 很多 ...

  7. Python爬取京东任意商品数据实战总结

    利用Python爬取京东任意商品数据 今天给大家展示爬取京东商品数据 首先呢还是要分思路的,我分为以下几个步骤: 第一步:得到搜索指定商的url 第二步:获得搜索商品列表信息 第三步:对得到的商品数据 ...

  8. python 爬取24小时天气数据

    python 爬取24小时天气数据 1.引入相关库 # -*- coding: utf-8 -*- import requests import numpy as np 关于爬虫,就是在网页上找到自己 ...

  9. 用python爬取基金网信息数据,保存到表格,并做成四种简单可视化。(爬虫之路,永无止境!)

    用python爬取基金网信息数据,保存到表格,并做成四种简单可视化.(爬虫之路,永无止境!) 上次 2021-07-07写的用python爬取腾讯招聘网岗位信息保存到表格,并做成简单可视化. 有的人留 ...

  10. python爬淘宝app数据_一篇文章教会你用Python爬取淘宝评论数据(写在记事本)

    [一.项目简介] 本文主要目标是采集淘宝的评价,找出客户所需要的功能.统计客户评价上面夸哪个功能多,比如防水,容量大,好看等等. [二.项目准备工作] 准备Pycharm,下载安装等,可以参考这篇文章 ...

最新文章

  1. 【Docker】容器的几种网络模式
  2. 惊!史上最全的select加锁分析(Mysql)
  3. Spark的Local模式及案例
  4. SQL中like的用法
  5. Java文件类字符串getAbsolutePath()方法(带示例)
  6. windows搜索工具_加快搞定并替代 Windows 10 搜索框搜索文件速度的免费小工具
  7. 洛谷2149 Elaxia的路线(dp+最短路)
  8. javascript学习之数组的使用二 forEach方法
  9. [Unity] Unity3D研究院编辑器之自定义默认资源的Inspector面板
  10. 鸿蒙系统装机量,王成录:华为对今年鸿蒙OS系统的装机量预估是3亿台
  11. officescan 不输入密码卸载
  12. win7文件夹加密软件_winRAR去广告版软件安装教程
  13. php 时间转换时间戳_PHP日期格式转时间戳
  14. 怎样解题:写题解思考问题的原则
  15. 树莓派chromium代理设置
  16. BLE技术知识点大全
  17. 英特尔cpu与主板芯片组对应关系(包含12代)
  18. 【2022年终总结】将哈佛大学Reich数据包中的352例SGDP样本进行Admixture分析的结果
  19. Unity中的角色属性芒星比例图
  20. QT多线程之:moveToThread

热门文章

  1. 对华为鸿蒙未来的展望,流畅度猛增42%!华为鸿蒙系统发布:百机焕新,IoT时代的未来已来...
  2. 接口引用变量调用方法
  3. 【经验分享】转行如何自学C/C++语言并且找到工作,分享自己心得
  4. java验证公钥私钥是否匹配及公钥私钥与字符串相互转换
  5. 如何在Word文档中“囗”打勾或叉
  6. css中a标签锚点、内部样式引入详解,css语法简单介绍
  7. Python基础刷题录-1
  8. c语言递归算法老鼠走迷宫详解,递归算法求老鼠走迷宫(C语言)
  9. vsto excel 表格存在循环引用 删除名称管理器很慢
  10. java 拆分句子,并保留分隔符