Capturing cookies with chromote produces an error

Hello, I am trying to access a password-protected account with {chromote}, and I'm having trouble capturing the cookies. I'm following along with the {chromote} README, which says to access the account you want in Chrome, open devtools on devtools in Chrome, then run some Javascript to capture the cookies as a string.

A regex (sort of):

  1. Navigate to https://rstudio.com (As an example)
  2. Press Ctrl/Cmd + Shift + I to open Chrome devtools
  3. While on the undocked devtools window, press Ctrl/Cmd + Shift + I again
  4. Run this code in the devtools terminal:
var cookies = await Main.sendOverProtocol('Network.getCookies', {})
JSON.stringify(cookies)

When I do this, it gives me the error: Uncaught TypeError: Main.sendOverProtocol is not a function

FWIW here are my two devtools windows. I know virtually nothing about web dev/web design, so I don't know if any of the other errors are related.

Any help or guidance is greatly appreciated! I'm not even sure what questions to ask.

For future me, or anyone else, I ended up solving this using the "Export cookie JSON file for Puppeteer" Chrome extension. This extension allows you to export your cookies for any Chrome tab. You then wrap'[{"cookies":' and }] around the output of that extension, and it is readable by {chromote} as described in the README.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.