|
python3小白,求助关于正则表达式爬取豆瓣图书,一直卡在那也不报错,不知道问题出在哪???
SevenSir 如果你是解析html的话,用pyquery吧。很好用。py的正则我觉得挺麻烦的。推荐你一个学习正则的工具:https://deerchao.net/tools/regester/index.htm ...嗯呢,用正则解析html感觉确实挺麻烦,谢谢啦 |
|
python3小白,求助关于正则表达式爬取豆瓣图书,一直卡在那也不报错,不知道问题出在哪???
import requests #print (content) #print(results) |
|
python3小白,求助关于正则表达式爬取豆瓣图书,一直卡在那也不报错,不知道问题出在哪???
OxCL 貌似是 re.findall 的问题,虽然也不知道则么会卡住,不过 html 的话用 pyquery 或 BeautifulSoup 比较方便吧,应该也不会有这个问题据说正则挺重要,所以就想学学,结果刚入门就入坑了 |
|
python3小白,求助关于正则表达式爬取豆瓣图书,一直卡在那也不报错,不知道问题出在哪???
junkboy 没有实际测试,但我觉得可能是正则表达式的非贪婪模式引起的。可以试试优化一下表达式不会优化,能帮忙指点下吗? |
|
python3小白,求助关于正则表达式爬取豆瓣图书,一直卡在那也不报错,不知道问题出在哪???
SevenSir 能描述清楚。卡在第几行?哪一个函数?这个不知道,因为就一直卡然后啥也没有,估计是re.compile那里在匹配时候出了问题吧! |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值