Closed lpongetti closed 3 months ago
With rod you can do:
page.Context(ctx).MustWaitDownload(...)
Please check the doc: https://go-rod.github.io/#/context-and-timeout
I already tryed this solution but it's not the same thing. I wanna a context only for the file download and not for the browser. If i wanna downalod file i can wait only 30 seconds for example. If the download fails i can do other things or try again.
I think you have misunderstood what I mean, for example, the code below, those 2 lines don't share the same context:
// if first one fails
page.Timeout(30 * time.Second).MustWaitDownload(...)
// try again
page.Timeout(20 * time.Second).MustWaitDownload(...)
It's a clone of the page, page.Context
never modifies the origin page.
Pass a context to MustWaitDownload and MustWait to not block everything in case of file not downloaded