playwright-community / playwright-go

Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
https://playwright-community.github.io/playwright-go/
MIT License
2.11k stars 156 forks source link

(f *frameImpl) Content() panic #366

Closed zouxingyuks closed 1 year ago

zouxingyuks commented 1 year ago

log: panic: interface conversion: interface {} is nil, not string

goroutine 111 [running]: github.com/playwright-community/playwright-go.(frameImpl).Content(0x1?) D:/Document/GO/pkg/mod/github.com/playwright-community/playwright-go@v0.3500.0/frame.go:70 +0x5c github.com/playwright-community/playwright-go.(pageImpl).Content(0xc0002d6380?) D:/Document/GO/pkg/mod/github.com/playwright-community/playwright-go@v0.3500.0/page.go:176 +0x28 pc_boss/service.(Page).Get(0xc0002abd80) D:/Item/pc_boss/service/pages.go:131 +0x92d pc_boss/service.(Data).Find(0xc000281c80, {0x1052550, 0x6}) D:/Item/pc_boss/service/pages.go:72 +0x36a main.main.func1({{{0xc00026ae90, 0x6}, {0xc00026ae96, 0x9}}, {{0xc00026aea0, 0x9}, {0xc00026aeaa, 0x6}}, {{0xc00026aeb0, 0x9}, ...}}, ...) D:/Item/pc_boss/main.go:60 +0xa7 created by main.main D:/Item/pc_boss/main.go:59 +0x694

在代码运行一段时间后会不间断报错,且 Page.Content() 并没有成功返回error

zouxingyuks commented 1 year ago

具体报错位置应该在 playwright-community/playwright-go@v0.3500.0/frame.go:70

canstand commented 1 year ago

等 #367 合并之后可以解决。

canstand commented 1 year ago

@zouxingyuks 已经更新,用 main 分支代码 go get -u github.com/playwright-community/playwright-go@main