问题
I want to set cookies from data in my cookie.json file. Right now I have 2 objects in my cookies collection. I want to get each object by incrementing the value of [i], so I can set each cookie at a time.
var cookie = JSON.parse(fs.readFileSync('cookies.json', 'utf8'));
for(var i = 0; i < cookie.length; i++)
{
await page.setCookie(...cookie[i]) //this line is not working, cookies is not writting
来源:https://stackoverflow.com/questions/60845736/how-set-cookie-from-array-of-objects-using-loop