Python-正则匹配

55 阅读1分钟
comments = re.findall('style="display:;">                    (.*?)</div>',html)
# 评论用户
users = re.findall('class="p_author_name j_user_card" href=".*?" target="_blank">(.*?)</a>',html)
# 评论时间
comment_times = re.findall('楼</span><span class="tail-info">(.*?)</span><div',html)

C:\xxxxx.py esbaw 2022-06-17 13:36 我支持克莱因为他穿的是安踏球鞋 ☆ost空之光 2022-06-17 13:37 就体育故事来说 克莱 国手李凯尔 2022-06-17 22:42 鸡屎高 寻歧 2022-06-17 22:53 你让克莱有哈登那哨子试试 库触 2022-06-17 23:12 哈登啊