shot-scraper
shot-scraper copied to clipboard
Option for scripted authentication
trafficstars
The
authcommand could take the standard--javascriptoption.It could also take a
--headlessoption - 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.