摘要: 上节回顾 # 1 selenium -登录cnblogs,拿到cookie,再打开cnblogs,写入cookie,它就是登录状态 -半自动点赞 》selenium生成的cookie,给requests用 -selenium操作浏览器,速度慢 -requests速度快 -动作链 -自动登录12306 阅读全文
posted @ 2023-03-21 14:53 tengyifan 阅读(31) 评论(0) 推荐(0)
摘要: 昨日回顾 #1 beautifulsoup4 使用 -xml解析库,用它来解析爬取回来的html内容,从中找出我们需要的内容 #2 遍历文档树 - . 的使用 soup.html.body.p.a - 获取属性 对象.attrs.get('href') - 获取文本 对象.text string s 阅读全文
posted @ 2023-03-21 14:52 tengyifan 阅读(65) 评论(0) 推荐(0)