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

文件实际下载完成但浏览器依然被阻塞 #855

Closed
cooiter opened this issue Apr 2, 2023 · 2 comments
Closed

文件实际下载完成但浏览器依然被阻塞 #855

cooiter opened this issue Apr 2, 2023 · 2 comments
Labels
question Questions related to rod

Comments

@cooiter
Copy link

cooiter commented Apr 2, 2023

Rod Version: v0.112.8

package main

import (
	"github.com/go-rod/rod"
	"github.com/go-rod/rod/lib/launcher"
	"log"
)

func main {
	l, _ := launcher.New().
		Set("disable-web-security").
		Set("disable-setuid-sandbox").
		Set("no-sandbox").
		Set("no-first-run").
		Set("disable-gpu").
		Headless(true).
		Launch()

	browser := rod.New().ControlURL(l).Trace(true).MustConnect()
	defer browser.MustClose()

	page := browser.MustPage("http://www.stcmcudata.com/")

	wait := browser.WaitDownload(`D:\Downloads\TmpDownloads`)

	page.MustElement(`body > table:nth-child(6) > tbody > tr > td:nth-child(5) > dl > dd:nth-child(28) > a`).MustClick()

	info := wait()
	log.Println("info:", info)
}
=== RUN  
[launcher.Browser]2023/04/02 17:44:11 try to find the fastest host to download the browser binary
[launcher.Browser]2023/04/02 17:44:11 check https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/1101464/chrome-win.zip
[launcher.Browser]2023/04/02 17:44:11 check https://registry.npmmirror.com/-/binary/chromium-browser-snapshots/Win_x64/1101464/chrome-win.zip
[launcher.Browser]2023/04/02 17:44:11 check https://playwright.azureedge.net/builds/chromium/1101464/chromium-linux-arm64.zip
[launcher.Browser]2023/04/02 17:44:12 check result: Get "https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/1101464/chrome-win.zip": context canceled
[launcher.Browser]2023/04/02 17:44:12 check result: Get "https://playwright.azureedge.net/builds/chromium/1101464/chromium-linux-arm64.zip": context canceled
[launcher.Browser]2023/04/02 17:44:12 Download: https://registry.npmmirror.com/-/binary/chromium-browser-snapshots/Win_x64/1101464/chrome-win.zip
[launcher.Browser]2023/04/02 17:44:12 Progress:
[launcher.Browser]2023/04/02 17:44:12 00%
[launcher.Browser]2023/04/02 17:44:13 05%
[launcher.Browser]2023/04/02 17:44:14 10%
[launcher.Browser]2023/04/02 17:44:15 15%
[launcher.Browser]2023/04/02 17:44:16 20%
[launcher.Browser]2023/04/02 17:44:17 25%
[launcher.Browser]2023/04/02 17:44:18 30%
[launcher.Browser]2023/04/02 17:44:19 35%
[launcher.Browser]2023/04/02 17:44:20 40%
[launcher.Browser]2023/04/02 17:44:21 45%
[launcher.Browser]2023/04/02 17:44:22 49%
[launcher.Browser]2023/04/02 17:44:23 53%
[launcher.Browser]2023/04/02 17:44:24 58%
[launcher.Browser]2023/04/02 17:44:25 63%
[launcher.Browser]2023/04/02 17:44:26 68%
[launcher.Browser]2023/04/02 17:44:27 74%
[launcher.Browser]2023/04/02 17:44:28 80%
[launcher.Browser]2023/04/02 17:44:29 86%
[launcher.Browser]2023/04/02 17:44:30 91%
[launcher.Browser]2023/04/02 17:44:31 96%
[launcher.Browser]2023/04/02 17:44:32 100%
[launcher.Browser]2023/04/02 17:44:32 Unzip to: C:\Users\thinkpad\AppData\Roaming\rod\browser\chromium-1101464
[launcher.Browser]2023/04/02 17:44:32 Progress:
[launcher.Browser]2023/04/02 17:44:32 00%
[launcher.Browser]2023/04/02 17:44:33 16%
[launcher.Browser]2023/04/02 17:44:34 33%
[launcher.Browser]2023/04/02 17:44:35 52%
[launcher.Browser]2023/04/02 17:44:36 69%
[launcher.Browser]2023/04/02 17:44:37 87%
[launcher.Browser]2023/04/02 17:44:38 100%
[rod] 2023/04/02 17:44:40 [query] rod.element("body > table:nth-child(6) > tbody > tr > td:nth-child(5) > dl > dd:nth-child(28) > a")  <page:EC05438D>
[rod] 2023/04/02 17:44:40 [query] rod.element("body > table:nth-child(6) > tbody > tr > td:nth-child(5) > dl > dd:nth-child(28) > a")  <page:EC05438D>
[rod] 2023/04/02 17:44:41 [query] rod.element("body > table:nth-child(6) > tbody > tr > td:nth-child(5) > dl > dd:nth-child(28) > a")  <page:EC05438D>
[rod] 2023/04/02 17:44:41 [wait] interactable <a>
[rod] 2023/04/02 17:44:41 [input] scroll into view <a>
[rod] 2023/04/02 17:44:41 [wait] visible <a>
[rod] 2023/04/02 17:44:41 [wait] stable RAF <a>
[rod] 2023/04/02 17:44:41 [wait] enabled <a>
[rod] 2023/04/02 17:44:41 [input] left click <a>

What have you tried to solve the question

使用edge浏览器也是同样会被阻塞,换AMD台式机也是如此

@cooiter cooiter added the question Questions related to rod label Apr 2, 2023
@rod-robot
Copy link

Please fix the golang code in your markdown:

@@ golang markdown block 1 @@
9:11: expected '(', found '{'
10:7: missing ',' in parameter list
10:22: missing ',' in parameter list
10:24: expected ';', found '.'
20:2: expected declaration, found 'defer'

generated by check-issue

@ysmood
Copy link
Member

ysmood commented Apr 2, 2023

你选中点击的这个按钮并不会触发下载,所以一直等不会发生的事件

@cooiter cooiter closed this as completed Apr 2, 2023
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

3 participants