请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

browser = uc.Chrome() 调试到此步骤出错

我的chrome版本是92 断点到这一步运行出现以下提示,还有先前遗漏的问题一直未解决,老师是否可以加我qq跟踪下问题,我的qq:123399918
2022-01-08 10:07:09 [undetected_chromedriver.patcher] DEBUG: unzipping C:\Users\Lenovo\AppData\Local\Temp\tmpn6nkfp85
2022-01-08 10:07:09 [undetected_chromedriver.patcher] INFO: patching driver executable C:\Users\Lenovo\appdata\roaming\undetected_chromedriver\chromedriver.exe
2022-01-08 10:07:09 [uc] DEBUG: created a temporary folder in which the user-data (profile) will be stored during this
session, and added it to chrome startup arguments: --user-data-dir=C:\Users\Lenovo\AppData\Local\Temp\tmpwsi09lud
2022-01-08 10:07:09 [uc] DEBUG: did not find a bad exit_type flag
2022-01-08 10:07:09 [scrapy.core.engine] ERROR: Error while obtaining start requests
Traceback (most recent call last):
File “E:\scrapy\envs\python38\lib\site-packages\scrapy\core\engine.py”, line 129, in next_request
request = next(slot.start_requests)
File “E:\scrapy\code\ArticleSpider\ArticleSpider\spiders\cnblogs.py”, line 15, in start_requests
browser = uc.Chrome()
File "E:\scrapy\envs\python38\lib\site-packages\undetected_chromedriver_init
.py", line 356, in init
self.browser_pid = start_detached(
File “E:\scrapy\envs\python38\lib\site-packages\undetected_chromedriver\dprocess.py”, line 30, in start_detached
multiprocessing.Process(
File “d:\anaconda\lib\multiprocessing\process.py”, line 121, in start
self._popen = self._Popen(self)
File “d:\anaconda\lib\multiprocessing\context.py”, line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File “d:\anaconda\lib\multiprocessing\context.py”, line 327, in _Popen
return Popen(process_obj)
File “d:\anaconda\lib\multiprocessing\popen_spawn_win32.py”, line 45, in init
prep_data = spawn.get_preparation_data(process_obj._name)
File “d:\anaconda\lib\multiprocessing\spawn.py”, line 154, in get_preparation_data
_check_not_importing_main()
File “d:\anaconda\lib\multiprocessing\spawn.py”, line 134, in _check_not_importing_main
raise RuntimeError(’’'
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if name == ‘main’:
freeze_support()

The “freeze_support()” line can be omitted if the program
is not going to be frozen to produce an executable.
2022-01-08 10:07:09 [scrapy.core.engine] INFO: Closing spider (finished)
2022-01-08 10:07:09 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{‘elapsed_time_seconds’: 16.25926,
‘finish_reason’: ‘finished’,
‘finish_time’: datetime.datetime(2022, 1, 8, 2, 7, 9, 285794),
‘log_count/DEBUG’: 5,
‘log_count/ERROR’: 1,
‘log_count/INFO’: 11,
‘start_time’: datetime.datetime(2022, 1, 8, 2, 6, 53, 26534)}
2022-01-08 10:07:09 [scrapy.core.engine] INFO: Spider closed (finished)
2022-01-08 10:07:09 [uc] DEBUG: closing webdriver
2022-01-08 10:07:09 [uc] DEBUG: killing browser
2022-01-08 10:07:09 [uc] DEBUG: successfully removed C:\Users\Lenovo\AppData\Local\Temp\tmpwsi09lud

正在回答 回答被采纳积分+3

3回答

若羲 2022-06-02 19:18:24
 driver = uc.Chrome(use_subprocess=True)
0 回复 有任何疑惑可以回复我~
  • bobby #1
    其他同学可以试试
    回复 有任何疑惑可以回复我~ 2022-06-02 22:04:26
lazymyth 2022-01-14 09:30:09

同样出现这个问题。我看这个问题出现的还不少,老师可以统一做个说明

0 回复 有任何疑惑可以回复我~
  • github 上面已经取消undetected_chromedriver.v2的引用,请直接使用import undetected_chromedriver as uc
    回复 有任何疑惑可以回复我~ 2022-02-05 13:00:30
bobby 2022-01-13 12:37:15

你留个qq 我加你看看

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信