I am super new to using GAS and Cheerio to scrape data.
I want the data on this page:
https://archiveofourown.org/users/[USERNAME]/stats
I cannot figure out how to get the script (below) working to log in.
function ao3Login() {
var url = "https://archiveofourown.org/users/login";
var payload = {
"user[login]":"username",
"user[password]":"password"
};
var opt = {
"payload":payload,
"method":"post",
"followRedirects": false
};
var response = UrlFetchApp.fetch(url, opt);
var sessionDetails = response.getAllHeaders()['Set-Cookie'];
var header = {
'Cookie': sessionDetails[1]
};
Logger.log(response.getResponseCode());
Logger.log(response);
}