使用undetected_chromedriver 在scrapy框架中下start_requests方法登录cnblog获取cookie报错

来源:4-8 . cnblogs模拟登录(新增内容)

weixin_慕移动6047834

2022-02-24

1.使用undetected_chromedriver在测试文件中测试cnblog博客园登录,没有问题,并且获取到了相关的cookie列表。
2. 但是将相同的登录代码逻辑写到scrapy框架中的 start_requests方法中,报错,报错内容如下图:
图片描述
通过debug定位到出错的行为:broswer = uc.Chrome() 初始化Chrome出错,排除网络原因,重试了1天也没什么效果
请帮助解决

写回答

2回答

TrWyFowrd

2022-03-02

import undetected_chromedriver.v2 as uc
browser = uc.Chrome(use_subprocess=True)
browser.get("https://account.cnblogs.com/signin")
           

下载视频          

0
0

bobby

2022-02-27

0
0

Scrapy打造搜索引擎 畅销4年的Python分布式爬虫课

带你彻底掌握Scrapy,用Django+Elasticsearch搭建搜索引擎

5829 学习 · 6293 问题

查看课程