# Code sample for logging into a web site and downloading a csv file

**URL:** <https://discourse.julialang.org/t/code-sample-for-logging-into-a-web-site-and-downloading-a-csv-file/60057>\
**Category:** New to Julia\
**Created:** [April 26, 2021, 7:50pm UTC](https://discourse.julialang.org/t/code-sample-for-logging-into-a-web-site-and-downloading-a-csv-file/60057 "2021-04-26T19:50:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon69491625](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Post date:** [April 26, 2021, 7:50pm UTC](https://discourse.julialang.org/t/code-sample-for-logging-into-a-web-site-and-downloading-a-csv-file/60057/1 "2021-04-26T19:50:42Z")

</div>

Hi there,  
I have looked around on discourse and can’t seem to find a suggested approach that offers best practices for the following:

1 go to a web site  
2 login using user and password  
3 navigate to a page  
4 download a csv file

I have found many ideas as to HOW to do it, but I think it would be nice to have a CURRENT best practices for something that might be a common requirement. If I missed something that exists I am sorry.

---

<div class="post-metadata">

**Author:** ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)\
**Post date:** [April 26, 2021, 8:01pm UTC](https://discourse.julialang.org/t/code-sample-for-logging-into-a-web-site-and-downloading-a-csv-file/60057/2 "2021-04-26T20:01:14Z")

</div>

From [Home · CSV.jl](https://csv.juliadata.org/stable/).  
There’s not that much to it:

```julia
f = CSV.File(HTTP.get(url).body)

```

If you need authentication, you can pass headers to HTTP.  
[https://juliaweb.github.io/HTTP.jl/stable/public\_interface/](https://juliaweb.github.io/HTTP.jl/stable/public_interface/)

However, if by “go to a website. navigate to page”, you mean building a browser, then that’s a rather bigger job.

---

<div class="post-metadata">

**Author:** ![anon69491625](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Post date:** [April 26, 2021, 8:17pm UTC](https://discourse.julialang.org/t/code-sample-for-logging-into-a-web-site-and-downloading-a-csv-file/60057/3 "2021-04-26T20:17:38Z")

</div>

I found both those references but that’s not what my observation/question was. I was asking/postulating the need for a SINGLE best practices example that allows someone to go to a website ( by providing an url NOT writing a browser), send a user and password, and download a csv from that page. Thanks for the confirmation on the links though, I had looked at them but thought an example might be a better approach especially if it linked to the current documentation where the approach was outlined. My question/observation stands.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [April 26, 2021, 11:42pm UTC](https://discourse.julialang.org/t/code-sample-for-logging-into-a-web-site-and-downloading-a-csv-file/60057/4 "2021-04-26T23:42:25Z")

</div>

Isn’t this the type of service provided by sites like [dropbox.com](http://dropbox.com), [sync.com](http://sync.com), etc. ?

---

<div class="post-metadata">

**Author:** ![anon69491625](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Post date:** [April 27, 2021, 12:07am UTC](https://discourse.julialang.org/t/code-sample-for-logging-into-a-web-site-and-downloading-a-csv-file/60057/5 "2021-04-27T00:07:34Z")

</div>

maybe, BUT let’s say that the dataset is one that is proprietary information behind a paywall and the website owners aren’t too keen on having it on a 3rd party hosting site. How about someone in the maker community trying to run the site from their home to cut costs?
