unable goto ins page
twolao opened this issue · 0 comments
twolao commented
Environments
- playwright-go Version: [e.g. v0.4201.1]
- Browser: [e.g. firefox]
- OS and version: [e.g. macOS / Windows 11/ Ubuntu 22.04]
Bug description
unable access ins, for example: https://www.instagram.com/musickillskate/
how to resolve this problem?
To Reproduce
Please provide a mini reproduction rather than just a description. For example:
package main
import (
"fmt"
"log"
"github.com/playwright-community/playwright-go"
)
func main() {
pw, err := playwright.Run()
if err != nil {
log.Fatalf("could not start playwright: %v", err)
}
defer pw.Stop()
option := playwright.BrowserTypeLaunchOptions{
Headless: playwright.Bool(false),
}
browser, err := pw.Firefox.Launch(option)
if err != nil {
log.Fatalf("could not launch browser: %v", err)
}
defer browser.Close()
context, err := browser.NewContext(playwright.BrowserNewContextOptions{
Locale: playwright.String("en-US"),
TimezoneId: playwright.String("Europe/Berlin"),
})
if err != nil {
log.Fatalf("could not create browser context: %v", err)
}
defer context.Close()
context.SetExtraHTTPHeaders(map[string]string{
"Accept-Language": "en-US;q=0.3,en;q=0.2",
})
page, err := context.NewPage()
if err != nil {
log.Fatalf("could not create page: %v", err)
}
if _, err := page.Goto("https://www.instagram.com/musickillskate/"); err != nil {
log.Fatalf("could not go to: %v", err)
}
fmt.Println("Press ENTER to continue...")
fmt.Scanln()
if err := page.Close(); err != nil {
log.Fatalf("could not close page: %v", err)
}
}
Additional context
Add any other context about the problem here.