shot-scraper icon indicating copy to clipboard operation
shot-scraper copied to clipboard

Option for scripted authentication

Open simonw opened this issue 2 years ago • 1 comments

The auth command could take the standard --javascript option.

It could also take a --headless option - which causes it to open the page in regular headless mode, execute that JavaScript and then close the page again.

This would allow you to automate logins on pages that support it:

shot-scraper auth https://site.local/ auth.json --headless --javascript "
document.getElementById('#username').value = 'username';
document.getElementById('#password').value = 'password';
document.forms[0].submit();
"

Originally posted by @simonw in https://github.com/simonw/shot-scraper/issues/18#issuecomment-1065953345

simonw avatar Mar 12 '22 20:03 simonw

I'm not sure how this should work across multiple page loads.

simonw avatar Mar 29 '22 00:03 simonw