Sample code to use Puppeteer library. It makes the background of GitHub's top page red and takes a screenshot of it.
This Node.js script uses async
/await
, so it requires Node.js 7.6 or later.
- Run
yarn
command in the root of the repository. - Create
creds.js
file which contains the following:
module.exports = {
"username": "YOUR_GITHUB_USERNAME",
"password": "YOUR_GITHUB_PASSWORD",
};
- Run
npm start
. It will log in to GitHub with your credentials, make the background of GitHub's top page red, and then take a screenshot of it. If successful, you will get a screenshot namedGitHub.png
.