首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用RuntimeError时使用undetected_chromedriver

使用RuntimeError时使用undetected_chromedriver
EN

Stack Overflow用户
提问于 2021-12-26 08:40:11
回答 1查看 1.7K关注 0票数 2

这是我的脚本(这是在https://github.com/ultrafunkamsterdam/undetected-chromedriver上可以找到的示例):

代码语言:javascript
运行
复制
import undetected_chromedriver as uc
driver = uc.Chrome()
driver.get('https://nowsecure.nl')

我知道这个错误:

代码语言:javascript
运行
复制
RuntimeError       (note: full exception trace is shown but execution is paused at: <module>)

        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.   File "D:\Users\Mark\python scripts\test_2.py", line 2, in <module> (Current frame)
    driver = uc.Chrome()   File "<string>", line 1, in <module>

我该怎么解决这个问题?

EN

回答 1

Stack Overflow用户

发布于 2022-07-18 21:11:27

尝试添加param <use_subprocess>:

代码语言:javascript
运行
复制
driver = uc.Chrome(use_subprocess=True)

https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/384被发现

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70485179

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档