shot-scraper
shot-scraper copied to clipboard
Option for scripted authentication
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
I'm not sure how this should work across multiple page loads.