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)
- Get all javascript or css resources of the same-origin HOT 3
- page.MustExpose not work in launcher.NewAppMode() HOT 2
- Is it correct for me to call stealth like this? I want the entire browser to pass detection effectively, not a single page. Code: HOT 2
- Resources content is nil HOT 2
- rod resets settings of a chrome profile HOT 2
- Chinese garbled code HOT 2
- 浏览器的角标怎么设置? HOT 2
- 并发page pool, context deadline exceeded,page为什么没有释放? HOT 2
- Add support for Linux Arm? for downloading etc. HOT 4
- Add an initEvents public function with a Browser structure HOT 5
- page.Navigate(url), the page is like blocked HOT 1
- 测试时如何获取当前网页 HOT 5
- Click Button Eval Js Not Working HOT 4
- 获取点击后的response失败 HOT 2
- How to hide chromium command prompt HOT 2
- Element存在,但Element.MustHas却为false,检测不到Element HOT 2
- How to open a new Chrome window while using remote control HOT 4
- Using go-rod with firefox, failing to start new instance of firefox HOT 6
- How to disable the dialog when open External protocols HOT 2
- How to Set or replace response headers HOT 2
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.