admin管理员组文章数量:1416651
when i use this code to navigate a root link "/?language=en®ion=US" using chromedp. Aliexpress redirect me to the arabic page.
i need to get to directly to the english page
this is the code that i'm using :
err := chromedp.Run(ctx,
chromedp.EmulateViewport(1920, 1980),
// Navigate to AliExpress with English language and US region
chromedp.Navigate(`/?language=en®ion=US`),
chromedp.WaitVisible(`body`, chromedp.ByQuery),
chromedp.Sleep(5*time.Second), // Wait for the page to fully load
// Extract all links with their text and href
chromedp.Evaluate(`
JSON.stringify(
Array.from(document.querySelectorAll('a')).map(a => ({
text: a.textContent.trim(),
href: a.href
}))
)
`, &links),
)
if err != nil {
log.Fatal(err)
}
if there is away to add some header first please help me
本文标签: goheadless browser using chromedp from scraping aliexpressStack Overflow
版权声明:本文标题:go - headless browser using chromedp from scraping aliexpress - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745255166a2650056.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论