Comments (8)
Please add a valid Rod Version: v0.0.0
to your issue. Current version is v0.114.5
generated by check-issue
from rod.
The WaitDownload method allows you to specify the dir:
Line 504 in d2ad7cb
from rod.
if I specify in waitdownload then my file gets downloaded with alphanumeric characters and not with the original filename. And if I dont use waitdownload then it gets downloaded in downloads folder with the correct filename
from rod.
Then you need to config the preference of the browser to change the download folder:
Line 248 in 009545e
It's a json value like this:
Line 69 in 009545e
The doc of all preference:
https://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/pref_names.cc?view=markup#l1443
from rod.
tried this, it did not work. Still it gets downloaded in downloads folder
launcher.New().Preferences({"download":{"default_directory":
+mydir+}}
).
Also tried with ""savefile":{"default_directory":"/Users/xyz/"}"
and savefile.default_directory
from rod.
Another way to find out the correct key is to check a real pref when you config the chrome with the browser's settings page, so you don't need to guess it
from rod.
savefile.default_directory this mentioned in doc
I added this preference also downloadPrefernce := "{"download.default_directory":"/Users/xyz/"}"
and tried with savefile as well but nothing is working. Also in prefernces file also I checked in my system, it doesn't update the file with any way I tried.
from rod.
Works fine to me:
package main
import (
"github.com/go-rod/rod"
"github.com/go-rod/rod/lib/launcher"
"github.com/go-rod/rod/lib/utils"
)
func main() {
pref := `{
"download": {
"default_directory": "/Users/yad/Downloads/ttt"
}
}`
l := launcher.New().Preferences(pref).Headless(false)
u := l.MustLaunch()
rod.New().ControlURL(u).MustConnect().MustPage()
utils.Pause()
}
from rod.
Related Issues (20)
- How run multiple instances of chrome and have one manager go rod which handle this instances HOT 2
- ElementX stuck if you specify a non-existent element HOT 2
- Repeat login HOT 2
- 如何模拟鼠标滚动向下拉取加载数据? HOT 10
- Leakless feature problems... HOT 1
- 当浏览器关闭时,chrome_crashpad_handler和Chromium Helper两个进程没有被关闭。 HOT 3
- Is it possible to improve Screenshot's fullPage implementation? HOT 1
- Why doesn't it remember the window size now? HOT 11
- How to cancel the timeout for Elements (not just one)? HOT 1
- Intercept DevTools disconnection HOT 3
- How to ignore cert errors when HijackRequests is used? HOT 3
- Proxy auth dialog handler is not working in another tab HOT 4
- page.Elements result have cache? HOT 1
- navigation failed: net::ERR_INVALID_AUTH_CREDENTIALS HOT 11
- chromium can't login gmail account HOT 11
- NewUserMode最多启动2个浏览器,在尝试启动2个以上浏览器后卡住 HOT 11
- Alert Trojan Virus HOT 2
- After setting the default system device, the viewport display height and width are reversed. HOT 2
- hijack无法加载Other类型请求 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rod.