Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Gargl and pygargl to download file from website #21

Open
siyaoli opened this issue Sep 9, 2016 · 2 comments
Open

How to use Gargl and pygargl to download file from website #21

siyaoli opened this issue Sep 9, 2016 · 2 comments

Comments

@siyaoli
Copy link

siyaoli commented Sep 9, 2016

Hi,

I am trying to use Gargl and pygargl to download a xml file from website. After get into the website, I need to click some selections to confirm which items to be downloaded, then I click the button of "export data", it will download the xml file from the website to my computer. And there is some information "content-disposition:attachment; filename=Export090916.xml" from the response headers.But I cannot find anything in response body. Could you please give me some ideas about how to download the xml file using Gargl and pygargl?

Thanks!

@jodoglevy
Copy link
Owner

Hi,
What page are you doing this from, and what URLs are not providing any response body? Does the network tab show the response body for the same request/response?

@ghost
Copy link

ghost commented Sep 27, 2016

The response:
content-disposition:attachment; filename=Export090916.xml

gets stripped because the file name should be in quotes like:
content-disposition:attachment; filename="Export090916.xml"

We found the reason here:
https://foocompelsyou.wordpress.com/2012/10/01/the-curious-case-of-chrome-content-disposition-and-the-comma/

Since the response is not recorded in Chrome, we had to use cURL. Firefox is not as strict as Chrome and it will show the response even though the file name is not in quotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants