2021-06-13 10:10:53 [undetected_chromedriver.patcher] DEBUG: downloading from https://chromedriver.storage.googleapis.com/91.0.4472.101/chromedriver_win32.zip
2021-06-13 10:10:54 [undetected_chromedriver.patcher] DEBUG: unzipping C:\Users\GJW199~1\AppData\Local\Temp\tmp0sshb_xb
2021-06-13 10:10:54 [undetected_chromedriver.patcher] INFO: patching driver executable C:\Users\gjw199513\appdata\roaming\undetected_chromedriver\chromedriver.exe
2021-06-13 10:10:54 [scrapy.core.engine] ERROR: Error while obtaining start requests
Traceback (most recent call last):
File "D:\pythonvenv\ArticleSpider\lib\site-packages\scrapy\core\engine.py", line 129, in _next_request
request = next(slot.start_requests)
File "D:\pythonProject\ArticleSpider\ArticleSpider\spiders\zhihu.py", line 28, in start_requests
l = Login(USER, PASSWORD, 6)
File "D:\pythonProject\ArticleSpider\ArticleSpider\utils\zhihu_login_sel.py", line 228, in __init__
self.browser = uc.Chrome()
File "D:\pythonvenv\ArticleSpider\lib\site-packages\undetected_chromedriver\v2.py", line 282, in __init__
self.browser = subprocess.Popen(
File "D:\python3.8\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "D:\python3.8\lib\subprocess.py", line 1247, in _execute_child
args = list2cmdline(args)
File "D:\python3.8\lib\subprocess.py", line 549, in list2cmdline
for arg in map(os.fsdecode, seq):
File "D:\python3.8\lib\os.py", line 816, in fsdecode
filename = fspath(filename) # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not NoneType
Exception ignored in: <function Login.__del__ at 0x0FABED60>
Traceback (most recent call last):
File "D:\pythonProject\ArticleSpider\ArticleSpider\utils\zhihu_login_sel.py", line 340, in __del__
self.browser.close()
AttributeError: 'Login' object has no attribute 'browser'
2021-06-13 10:10:54 [scrapy.core.engine] INFO: Closing spider (finished)
2021-06-13 10:10:54 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'elapsed_time_seconds': 2.202878,
'finish_reason': 'finished',
'finish_time': datetime.datetime(2021, 6, 13, 2, 10, 54, 821716),
'log_count/DEBUG': 3,
'log_count/ERROR': 1,
'log_count/INFO': 11,
'start_time': datetime.datetime(2021, 6, 13, 2, 10, 52, 618838)}
2021-06-13 10:10:54 [scrapy.core.engine] INFO: Spider closed (finished)
如上是报错信息,我怀疑是找不到chrome路径,但是将chrome添加到path依旧无效
麻烦老师帮忙解决一下
带你彻底掌握Scrapy,用Django+Elasticsearch搭建搜索引擎
了解课程