Forums

Chromedriver don't download files

Hi! suddenly when i click with chromedriver (virtualdisplay) file doesn't download anymore, can you help me how to know where it goes (if downloaded). First time this task throw that error

Can you show us the error message you get?

There is no error message, just pass it normally, but there is no file :(

I also try: chrome_options.add_argument("download.default_directory=/home/clau2020/Downloads"), but still nothing happens

I think that the code you need to use for that would be more like this:

    options = webdriver.ChromeOptions()
    options.add_experimental_option(
        "prefs",
        {
            "download.default_directory": "/home/clau2020/Downloads"
        }
    )

    driver = webdriver.Chrome(chrome_options=options)

Doesn't work neither :(

Maybe is problem of system.path?

Add some logging to your code to see what your code is doing. Is it possible that you are setting the download directory in two different places in your code and one is overwriting the other? I have seen cases like that.

Is there a form to verify if a file exist in all my directories? I see that memory is getting more full when i download, even if i don't found the file where it supposed to download

No, i didn't set two times my download directory :(

You can look for a file from a Bash console using find command: find ~ -name <your-file-name> (repacing "<your-file-name> part with the file name). Did you try adding some logging as @fjl suggested?

Edit: "~" in the find command narrows down the search to your home directory.

I tried "find ~ -name final_" and returns nothing. My file is called "final_d.xlsx"

With -name option you need to provide full name or a name matching shell pattern. So you rather should use final_* otherwise it would look for files named final_.