Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux环境下运行 - pending replication details (maybe can't connect to Chrome) #511

Open
liutingqin opened this issue Jan 2, 2024 · 11 comments
Labels

Comments

@liutingqin
Copy link

liutingqin commented Jan 2, 2024

你好,我在linux环境下运行时,在执行r.init()之后,代码一直没有反应。
r.setup()执行正常。
我查看了之前关于linux系统的issue,发现最终好像都没有解决此问题,所以想问一下,这种情况该如何解决。
谢谢!

@liutingqin
Copy link
Author

运行图片

@kensoh
Copy link
Member

kensoh commented Jan 4, 2024

Hi @liutingqin, if it hangs there, it normally means cannot connect to Chrome browser. Maybe because of company IT policy blocking connecting to Chrome using websocket connection directly.

What is your Python script, do you just do r.init()?

Can you do r.debug(True) before r.init() to see if there is any other clue?

@kensoh kensoh added the query label Jan 4, 2024
@kensoh kensoh changed the title linux环境下运行 Linux环境下运行 - pending more clues and replication details (maybe can't connect to Chrome) Jan 4, 2024
@kensoh kensoh changed the title Linux环境下运行 - pending more clues and replication details (maybe can't connect to Chrome) Linux环境下运行 - pending replication details (maybe can't connect to Chrome) Jan 4, 2024
@liutingqin
Copy link
Author

谢谢回答,我做了很多次尝试与测试。我在ubuntu16.04与ubuntu20.04中运行代码时,会卡在r.init()过程中,如上图所示。后面我用ubuntu22.04的环境运行代码,代码跑通了,所以我想代码中是否有bug,导致不与非最新版本的ubuntu兼容。

@liutingqin
Copy link
Author

我的python script用的你的colab上的代码,所有环境都用的此代码。

@kensoh
Copy link
Member

kensoh commented Jan 6, 2024

Thanks for your reply!

It'll be hard to debug without getting more info using r.debug() before running r.init(). Does using r.debug() show anything?

When you run php -v from your Ubuntu terminal does it show different results for the 2 Ubuntu?

The rpa package uses TagUI engine which uses 1) built-in PhantomJS engine and 2) PHP in order to convert take the automation instructions and send it to Chrome to automate the actions on Chrome browser. It might be somewhere around there. Or something to do with firewall blocking connecting to Chrome with websocket connection.

@kensoh
Copy link
Member

kensoh commented Jan 6, 2024

(I can understand Chinese you can continue to reply in Chinese)

@liutingqin
Copy link
Author

你好!
我在r.init()的前面,使用了r.debug(),同样没有任何信息,也没有报错。
php的版本是PHP 8.1.2-1ubuntu2.14 (cli) (built: Aug 18 2023 11:41:11) (NTS)。
但是我在ubuntu22.04上运行成功了,因为我查了colab上的ubuntu环境版本是22.04,colab上的代码能直接运行成功。
所以我想,是否是相关依赖版本不兼容的问题。
因为我查看之前的issue,403和404issue好像与我的情况一致,最终都没有解决,所以我猜测这是一个普遍性问题。

@kensoh
Copy link
Member

kensoh commented Jan 6, 2024

Can you show me the Python code and steps you take to install and run? On the Ubuntu that does not work.

The Colab example has some setup steps that are designed for the new Ubuntu version, in order to install Chrome.

For example, below steps might not work on older Ubuntu, new Ubuntu requires below to install Chromium browser.

image

@liutingqin
Copy link
Author

谢谢,我现在已经将环境换成了ubuntu22.04,已经能够无头运行r.init()。但我现在想问一下,我已经安装了有桌面的ubuntu环境,我想在有桌面的ubuntu环境下启动rpa,我该如何配置,我发现我直接运行r.setup()之后再运行r.init()好像行不通,依旧是在r.init()这一步卡住。我是否需要设置--no-sandbox相关配置。谢谢!

@liutingqin
Copy link
Author

我想应该是要进行r.dump(r.load('/root/.tagui/src/tagui').replace('"google-chrome"', '"chromium"').replace('$headless_switch', '--no-sandbox'), '/root/.tagui/src/tagui')此配置。
但我不知道'$headless_switch'应该换成什么配置才能进行有头访问。

@liutingqin
Copy link
Author

谢谢,这个问题我已经解决。我发现用colab上的代码设置就已经可以实现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants