go - chromedp fails to start a new instance of chrome
问题描述
Hey guys I have been trying to automate a task on my browser's machine using chromedp.
I tried examples on the repo however they always fail:
unexpected fault address 0x7f7a36461000 fatal error: fault [signal SIGBUS: bus error code=0x2 addr=0x7f7a36461000 pc=0x53a9d5]
Example's source code am running can be found here.
As I understand chromedp comes with headless pre-compiled version of chrome. I have browsed the API documentation to see if it possible to pass a port on which the dev tools is listening, no success.
However when I tried mafredri/cdp it worked. I came to understand that chromedp is failing to start its embedded chrome. Although, I am not really sure. Why is this happening?
My env:
Google Chrome 85.0.4183.102
Ubuntu 18.04.4 LTS
go version go1.13.5 linux/amd64
Any help would be truly appreciated.
解决方案
So, long story short I went to run tests on the chromedp locally installed library through go test
, it failed. I opened an issue on the Github repo. While it was not indicated that it requires Go 1.14+ but it does.
If you encountered this issue, please proceed to first run the tests on the master branch locally installed library. If it is fails with the following log:
github.com/chromedp/chromedp [github.com/chromedp/chromedp.test] ./chromedp_test.go:862:3: t.Cleanup undefined (type *testing.T has no field or method Cleanup) ./chromedp_test.go:948:5: t.Cleanup undefined (type *testing.T has no field or method Cleanup) ./chromedp_test.go:950:5: t.Cleanup undefined (type *testing.T has no field or method Cleanup) FAIL github.com/chromedp/chromedp [build failed]
You need to know that t.Cleanup
was added on Go 1.14 (credits to Oiyoo).
I hope this helps you if you are having the same problem.
推荐阅读
- ruby-on-rails - 如何在 puma 杀死时打印线程回溯?
- node.js - 在单个 Azure Web 应用程序中使用 Angular 前端的 Node/Express 后端
- python-3.x - 根据条件替换 Pandas DF 列中的值
- android - 如何从回收站视图行正确开始下载?
- c++ - 如何发送和接收可变长度(取决于处理器)std::vector
使用 MPI - java - 得到 java.lang.RuntimeException ... 原因:从 GooglePlay 安装后首次启动应用程序后 java.lang.ClassNotFoundException
- python - 即使安装了 tkinter 的 buildpack,Heroku 应用程序也会崩溃
- vba - 尝试选择具有变量作为列号的单元格
- javascript - 使 React Web 应用程序中的 Redux 存储失效/刷新?
- sql - 需要为 2 个 ID 选择 2 个最近的日期