Try this. Executed on windows How to control the download of files with Selenium Python bindings in Chrome from selenium import webdriver from selenium. I use this library FileSaver. Your browser has saved an SVG image! This also helped on Linux Ubuntu - I had an exact same issue. Sad that it's and still adding slashes to the downloads path to make our code work. Show 4 more comments. R Dub R Dub 5 5 silver badges 23 23 bronze badges. Somehow that's not working for me. I even tried both "true" and True since I don't know if that's supposed to be a string or a boolean , but neither syntax worked.
Unfortunately, modifying Chrome's Preferences file directly is not an option to me. The thing is, I need to set the download folder on my Python script, not on Chrome's Preferences file. That's because I'll need to have several different download folders and iterate over them, saving a few hundred downloaded files to each folder.
I was not recommending you hand edit the file, I was just using that method as a quick test bed. That was the key for me. Edited answer with a code sample. One other thought Thanks for the follow up, R Dub. Alas, I still can't make it work. You mentioned you are using a Windows install, so I wonder if it's some Mac issue. Well, I'll keep trying. That is: os.
So your solution is to set it permanently, system-wide on the machine I'm running this? So when any other application, even outside of this script wants a download folder it gets what was last set by this script, correct? You are right, there is a big problem setting the variable as system-wide I discover the side effects that you comment some weeks ago. A workaround could be store temporally the older path and restore after finish the app and really ensure that it is restored the path if the script fails or so.
Cpt Kitkat 1, 1 1 gold badge 25 25 silver badges 46 46 bronze badges. LamerLink LamerLink 91 6 6 bronze badges. I had the same problem and this method worked for me. Natan Lieberman Natan Lieberman 1. Anand Anand 1, 1 1 gold badge 10 10 silver badges 21 21 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Who owns this outage? Building intelligent escalation chains for modern SRE.
Podcast Who is building clouds for the independent developer? Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer.
Feb 2, Jan 9, Sep 22, Download the file for your platform. If you're not sure which to choose, learn more about installing packages. Warning Some features may not work without JavaScript. Please try enabling it if you encounter problems.
Search PyPI Search. Latest version Released: Sep 27, Navigation Project description Release history Download files. Project links Homepage. Maintainers scriptworld.
0コメント