50733

Automating File Download of a link that looks like this: https://www.domain.com/TableData/TableA.csv

Question:

I am trying to write an application that will download .csv and .xls files and save them into a folder that will be accessed later by a VBA macro. I am posting this question after the unsuccessful use of the solution in the following link: <a href="https://stackoverflow.com/questions/17877389/how-do-i-download-a-file-using-vba-without-internet-explorer" rel="nofollow">How do i download a file using VBA (Without internet explorer)</a>

The macro runs successfully, but the downloaded .csv file only contains the html from the login page. I find that strange because when I copy and paste the link directly into the browser without logging in, I am immediately prompted with a save, open, close window for the file.

As much as possible I am trying to avoid using SendKeys, but I can't seem to find another solution that works. I am not opposed to options other than VBA. Any help would be appreciated, thank you.

Answer1:

Your browser stores cookies which likely allows you to login automatically. Try browsing the page in different tabs in an incognito browser and you'll likely have to login each time.

You'll have to find a way to make the same requests your browser is sending to login, and use the cookies stored to make the requests to download the files.

Recommend

  • Converting string to date in Crystal Reports
  • Converting string to date in Crystal Reports
  • Python function optional arguments - possible to add as condition?
  • How to use an EventToCommand with an editable Combobox to bind TextBoxBase.TextChanged with a comman
  • How do I pass worksheet and ranges as variables?
  • How to remove left and right margins from all wrapped rows in flexbox (without nth-child or js)
  • Unable to run SDL program in Eclipse but able to do so in Windows Explorer
  • Application bar icon text length
  • nonblocking BIO_do_connect blocked when there is no internet connected
  • How to view images from protected folder with php?
  • ViewController With Transparent Background Entering Current ViewController With Push Transition
  • Problem while Building a Setup Project for a windows Service?
  • Marklogic : Query response time is very high
  • Webgrid not refreshing after delete MVC
  • Jquery UI tool tip close icon
  • Django rest serializer Breaks when data exists
  • Recording logins for password protected directories
  • Is there any way to access browser form field suggestions from JavaScript?
  • C# - Is there a limit to the size of an httpWebRequest stream?
  • Is my CUDA kernel really runs on device or is being mistekenly executed by host in emulation?
  • Sony Xperia Z Tablet not found by adb
  • Excel - Autoshape get it's name from cell (value)
  • Check if a string to interpolate provides expected placeholders
  • Perl system calls when running as another user using sudo
  • htaccess rewriting URLs with multiple forward slashes
  • Display Images one by one with next and previous functionality
  • Web-crawler for facebook in python
  • RestKit - RKRequestDelegate does not exist
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Traverse Array and Display in markup
  • A cron job substitute?
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Getting error when using KSoap library to consume .NET web services
  • coudnt use logback because of log4j
  • Qt: Run a script BEFORE make
  • How can I remove ASP.NET Designer.cs files?
  • python draw pie shapes with colour filled
  • Is there any way to bind data to data.frame by some index?
  • How can i traverse a binary tree from right to left in java?