go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.
https://go-rod.github.io
MIT License
5.25k stars 345 forks source link

获取点击后的response失败 #1055

Closed pqj325 closed 4 months ago

pqj325 commented 4 months ago

Rod Version: v0.114.8

期望登录成功后,点击 档案注册,到一个页面,获取返回的response

代码如下:

    var login_success bool
    login_success, page = uibase.Login_YTH(kehu, page)
    if login_success {
        // 获取事件细节
        e := proto.NetworkResponseReceived{}
        log.Println("e")
        wait := page.EachEvent(func(e *proto.PageLoadEventFired) (stop bool) {
            return true
        })
        log.Println("wait start")
        page.MustSearch("需要档案注册").MustDoubleClick()
        log.Println("click")
        wait()
        log.Println("wait end")
        log.Println(e.Response.Status)
    }

What you got

2024/05/04 11:07:09 成功登录
2024/05/04 11:07:09 e
2024/05/04 11:07:09 wait start
[rod] 2024/05/04 11:07:09 [query] () => this.parentElement() #text <page:CA72B87C>
[rod] 2024/05/04 11:07:09 [wait] interactable <div.x-grid3-cell-inner.x-grid3-col-1>
[rod] 2024/05/04 11:07:09 [input] scroll into view <div.x-grid3-cell-inner.x-grid3-col-1>
[rod] 2024/05/04 11:07:10 [wait] visible <div.x-grid3-cell-inner.x-grid3-col-1>
[rod] 2024/05/04 11:07:10 [wait] stable RAF <div.x-grid3-cell-inner.x-grid3-col-1>
[rod] 2024/05/04 11:07:11 [wait] enabled <div.x-grid3-cell-inner.x-grid3-col-1>
[rod] 2024/05/04 11:07:11 [input] left click <div.x-grid3-cell-inner.x-grid3-col-1>
2024/05/04 11:07:12 click

到这里就不动了。

What you expect to see

获取 response,并打印200

What have you tried to solve the question

尝试过hijack,但由于header里面的存在加密信息,暂时无法调通。

github-actions[bot] commented 4 months ago

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: "## 期望登录成功后,点击 档案注册,到一个页面,获取返回的response"]
5 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```go"]
24 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## What you got"]
25 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```log"]
37 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]
39 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "## What you expect to see"]
43 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## What have you tried to solve the question"]

generated by check-issue

ysmood commented 4 months ago

322