We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
when use response.Body() in the page.OnResponse(HandleResponse) callback function, it will be stop running like this:
package main import ( "fmt" "github.com/playwright-community/playwright-go" ) func HandleResponse(response playwright.Response) { fmt.Println(response.URL()) body, err := response.Body() if err == nil { fmt.Println(body) } } func main() { pw, _ := playwright.Run() browser, _ := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{ Headless: playwright.Bool(true), }) context, _ := browser.NewContext() page, _ := context.NewPage() page.OnResponse(HandleResponse) _, err := page.Goto("https://github.com/") if err != nil { fmt.Printf(err.Error()) } defer func() { page.Close() browser.Close() pw.Stop() }() }
The text was updated successfully, but these errors were encountered:
Please provide verified reproducible code in markdown code block format.
Sorry, something went wrong.
pls use goroutine to get response body for now:
func HandleResponse(response playwright.Response) { go func() { fmt.Println(response.URL()) body, err := response.Body() if err == nil { fmt.Println(body) } }() }
No branches or pull requests
when use response.Body() in the page.OnResponse(HandleResponse) callback function, it will be stop running
like this:
The text was updated successfully, but these errors were encountered: