0

I want to download the html page using linux command wget

Example:

wget "https://stackexchange.com/users/5215687/dipankar-nalui?tab=inbox"

To download this page I need to send the login information via the URL.

How to do that ?

I want to know the URL something like this =>

https://stackexchange.com/users/5215687/dipankar-nalui??postlogin&Email=test%40user.com&Password=12345
  • It will depend on authentication implementation. From one site to another you will have different ways and hopefully not as URL cleartext... You may use tcpdump/wireshark to take a look at messages sent. – tonioc May 15 '18 at 15:56
1

Using either Firefox or Google Chrome, open developer tools (right click on the page and choose inspect) and then select the network tab.

Make sure you are recording requests and then login as normal on the page. Scroll through the network requests that were recorded (their will probably be a lot of them) until you find the one you want to recreate. Right click on the request and select copy as curl.

This will copy a curl command into your system clipboard that you should be able to paste directly into your shell recreating the exact request the browser made down to the cookies, headers, and query parameters.

0

You will want to select view source on the web page containing the form.

Look for the form tag it will look something like the line below, what you care about is the action part, that is where you need to post the data.

 <form method=post action=login.php> 

Look for the fields containing the inputs for username and password. Look for the name of the inputs.

 <input type=text name=username> </input>
 ...
 <input type=text name=password> </input>

Then append them to your wget, i.e.

wget https://somesite.com/login.php?username=foo&password=bar 

This can be different based on what language the page is written in or if it sends the data as JSON, etc. But look at the source and it will tell you what to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.