1

So I'm doing a very simple click on link to download file in selenium. It looks something like this:

driver.find_element_by_xpath('element_xpath{0}'.format(i)).click()

Which works just fine. My problem is sometimes chrome throws a ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION.

I googled that to find this question and basically chrome throws that error when there is a comma in the file name and I have verified that this is exactly what is happening in my case as well. Now I realize I might be able to fix this with perhaps the requests library using the same suggestions as the ones in the question above; namely wrapping the file name in quotes or replace the comma with another character.

But my question is, is there any way to handle this issue in selenium? Chrome throws the same error when I manually try to download the file, IE works fine. Switching the selenium driver to IE is something I would like to avoid because it creates a whole lot of other problems.

Any help is appreciated. Thanks.

doddy
  • 579
  • 5
  • 18
  • 1
    Is there a reason why you had deleted your previous question : https://stackoverflow.com/questions/52768809/chrome-throws-invalid-response-on-file-download-when-using-selenium and basically repost similar question ? – MooingRawr Oct 12 '18 at 13:31
  • 1
    Like previously stated on the other question, you have stated that manually downloading the file through chrome, yields the same error. So I'm not sure what you are expecting of Selenium to fix if you can't manually download the file in chrome. Sure you can use request and rename your file download by passing Chrome, or you can use another web driver.... – MooingRawr Oct 12 '18 at 13:34

0 Answers0