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

NetworkResponseReceivedExtraInfo.cookiePartitionKey结构体错误 #1097

Closed
DC3x6 opened this issue Jul 21, 2024 · 4 comments
Closed

NetworkResponseReceivedExtraInfo.cookiePartitionKey结构体错误 #1097

DC3x6 opened this issue Jul 21, 2024 · 4 comments
Labels
question Questions related to rod

Comments

@DC3x6
Copy link
Contributor

DC3x6 commented Jul 21, 2024

Rod Version: v0.116.2

问题描述

通过页面获取NetworkResponseReceivedExtraInfo事件,其中cookiePartitionKey转换失败

示例代码

var currentEvent proto.NetworkResponseReceived
var currentEventExtrainfo proto.NetworkResponseReceivedExtraInfo
waitCurrentEventResponseReceived := page.WaitEvent(&currentEvent)
waitCurrentEventExtrainfo := page.WaitEvent(&currentEventExtrainfo)
waitNavigation := page.WaitNavigation(proto.PageLifecycleEventNameNetworkAlmostIdle)
err = page.Navigate(u)
if err != nil {
	log.Error("could not navigate target", "url", u, "err", err)
}
waitNavigation()
// Wait for the window.onload event
			if err := page.WaitLoad(); err != nil {
				log.Error("on wait load error", "url", u, "err", err)
			}

			// wait for idle the network requests
			if err := page.WaitIdle(3); err != nil {
				log.Error("on wait idle error", "url", u, "err", err)
			}
waitCurrentEventResponseReceived()
			if currentEvent.HasExtraInfo {
				waitCurrentEventExtrainfo()
				println(currentEventExtrainfo.StatusCode)
			}

panic信息

image
@DC3x6 DC3x6 added the question Questions related to rod label Jul 21, 2024
Copy link

Please fix the format of your markdown:

3 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## 问题描述"]
7 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## 示例代码"]
8 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```go"]
36 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## panic信息"]
37:1 MD033/no-inline-html Inline HTML [Element: img]

generated by check-issue

@Fly-Playgroud
Copy link
Contributor

Fly-Playgroud commented Jul 21, 2024

降低 chrome 版本,建议使用 rod 测试通过的版本,在代码里面或者默认的 useragent 里面有。在高版本的chrome cdp 接口发生了变化。

@ysmood
Copy link
Member

ysmood commented Jul 22, 2024

@yeyu12
Copy link

yeyu12 commented Aug 13, 2024

https://github.com/yeyu12/rod/tree/v0.116.4 我把相关的字段注释,目前测下来,新版的和老版的都能用,没有过测试用例哈,仅供参考

@ysmood ysmood closed this as completed Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions related to rod
Projects
None yet
Development

No branches or pull requests

4 participants