- 博客(4)
- 收藏
- 关注
原创 【小白do问题】爬虫练习,断点调试,老是无法在要调试的地方显示
练习一个爬虫入门,断点调试的时候老是无法在第一个断点显示:from urllib import requestclass Spider(): url = 'https://live.bilibili.com/all?visit_id=2xogwy0pz3s0' def __fetch_content(self): r = request.urlopen(Sp...
2020-04-30 13:25:23
160
原创 【小白do问题】python正则 re.findall()把 \n 打印出来了,不能换行
python正则, 用 re.findall()提取两个字符间的字符,打印出来时候 \n 不是换行而是直接打印了。代码如下:test8 = 'When I do count the clock that tells the time,\ \n And see the brave day sunk in hideous night;\ \n When I behold the vi...
2020-04-25 22:29:29
1292
6
原创 【小白do笔记】python正则 AttributeError: 'NoneType' object has no attribute 'group' 问题与解决
练习用 search() 和 group() 提取一段文字,代码如下:import retest8 = 'When I do count the clock that tells the time,\ \nAnd see the brave day sunk in hideous night;\ \nWhen I behold the violet past prime,\...
2020-04-24 17:10:05
546
原创 【小白do问题】Python 正则练习,想找出字符串中的 \n,但是打不出来
#找出所有g 和 \n, 想要 [‘g, G, \n’],代码如下import retest6 = ‘hafbnmA\nEGIENB\ng’t6 = re.findall(‘g.{1}’, test6, re.I | re.S )print(t6)#求问为什么打印出来的结果是[‘GI’]...
2020-04-24 14:26:04
295
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人