嘿伙計們,我一直在嘗試使用chromedp在我的瀏覽器機器上自動執行一項任務。我在 repo 上嘗試了示例,但它們總是失?。阂馔夤收系刂?0x7f7a36461000 致命錯誤:故障 [信號 SIGBUS:總線錯誤代碼=0x2 addr=0x7f7a36461000 pc=0x53a9d5]可以在此處找到正在運行的示例源代碼。據我了解,chromedp 帶有無頭預編譯版 chrome。我瀏覽了 API 文檔以查看是否可以傳遞開發工具正在偵聽的端口,但沒有成功。但是,當我嘗試mafredri/cdp時,它起作用了。我開始了解到 chromedp 無法啟動其嵌入式 chrome。雖然,我不太確定。為什么會這樣?我的環境:谷歌瀏覽器 85.0.4183.102Ubuntu 18.04.4 LTS去版本 go1.13.5 linux/amd64任何幫助將不勝感激。
1 回答

慕仙森
TA貢獻1827條經驗 獲得超8個贊
因此,長話短說,我通過 chromedp 本地安裝的庫運行測試go test
,但失敗了。我在 Github repo 上打開了一個問題。雖然沒有表明它需要 Go 1.14+,但它確實需要。
如果您遇到此問題,請先在 master 分支本地安裝的庫上運行測試。如果失敗并顯示以下日志:
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 [構建失敗]
您需要知道這t.Cleanup
是在 Go 1.14 上添加的(歸功于Oiyoo)。
如果您遇到同樣的問題,我希望這對您有所幫助。
- 1 回答
- 0 關注
- 233 瀏覽
添加回答
舉報
0/150
提交
取消