报错,是无法驱动浏览器吗

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

weixin_慕莱坞7263643

2022-06-04

2022-06-04 17:38:37 [uc] DEBUG: did not find a bad exit_type flag
2022-06-04 17:38:37 [scrapy.core.engine] ERROR: Error while obtaining start requests
Traceback (most recent call last):
  File "C:\Users\esr1293\first_env\lib\site-packages\scrapy\core\engine.py", line 150, in _next_request
    request = next(self.slot.start_requests)
  File "C:\Users\esr1293\first_env\Scripts\frame\frame\spiders\jobble.py", line 16, in start_requests
    browser=uc.Chrome()  #驱动浏览器
  File "C:\Users\esr1293\first_env\lib\site-packages\undetected_chromedriver\__init__.py", line 388, in __init__
    self.browser_pid = start_detached(
  File "C:\Users\esr1293\first_env\lib\site-packages\undetected_chromedriver\dprocess.py", line 30, in start_detached
    multiprocessing.Process(
  File "D:\新建文件夹 (2)\lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
  File "D:\新建文件夹 (2)\lib\multiprocessing\context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "D:\新建文件夹 (2)\lib\multiprocessing\context.py", line 327, in _Popen
    return Popen(process_obj)
  File "D:\新建文件夹 (2)\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "D:\新建文件夹 (2)\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
    _check_not_importing_main()
  File "D:\新建文件夹 (2)\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-06-04 17:38:37 [scrapy.core.engine] INFO: Closing spider (finished)
2022-06-04 17:38:37 [scrapy.statscollectors] INFO: Dumping Scrapy stats:
{'elapsed_time_seconds': 1.33106,
'finish_reason': 'finished',
'finish_time': datetime.datetime(2022, 6, 4, 9, 38, 37, 350070),
'log_count/DEBUG': 6,
'log_count/ERROR': 1,
'log_count/INFO': 11,
'start_time': datetime.datetime(2022, 6, 4, 9, 38, 36, 19010)}
2022-06-04 17:38:37 [scrapy.core.engine] INFO: Spider closed (finished)
2022-06-04 17:38:37 [uc] DEBUG: closing webdriver
2022-06-04 17:38:37 [uc] DEBUG: killing browser
2022-06-04 17:38:37 [uc] DEBUG: successfully removed C:\Users\esr1293\AppData\Local\Temp\tmpllpci5c1
2022-06-04 17:38:37 [undetected_chromedriver.patcher] DEBUG: successfully unlinked C:\Users\esr1293\appdata\roaming\undetected_chromedriver\7e5a8f11f51dd0a3_chromedriver.exe

写回答

1回答

weixin_慕莱坞7263643

提问者

2022-06-04

浏览器弹不出来

0
3
weixin_慕莱坞7263643
谢谢老师!
2022-06-08
共3条回复

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

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

5795 学习 · 6290 问题

查看课程