How will you download the website if it requires authentication using a username, password and an authenticity token? I tried the following below but I get stuck on the sign-in page;
I'm a freelance web developer from Japan.
Since I'm studying English, I started writing articles here.😆
I love internet💻, baseball⚾, rugby🏉, shogi☖, cat🐈, and sweets🍰
Top comments (4)
How will you download the website if it requires authentication using a username, password and an authenticity token? I tried the following below but I get stuck on the sign-in page;
!/usr/bin/env bash
username=username
password=password
code=
wget -qO- https://urlname/sign_in service=https://urlname.io | cat | grep 'name="lt"' | cut -d"_" -f2
hidden_code=_$code
wget --save-cookies cookies.txt \
--keep-session-cookies \
--post-data 'username=$username&password=$password<=$hidden_code&_eventId=submit' \
--auth-no-challenge
--delete-after \
urlname/sign_in?service=https://ur...
wget --load-cookies cookies.txt \
urlname.io
There is an important option which is
-c
. It helps to continue the download of the file.Thanks! I updated
-c
option.awesome article thank you. also, I have found another site scraper service. Maybe it will help someone too. e-scraper.com/useful-articles/down...