I want to get a HAR file using chrome.devtools.network.getHAR(). Specifically, I am using Selenium within a MahiMahi replay shell, and I want to inject
JS that will dump the
HAR into a file. The standard
JS injection (
executeScript method) does not work, because the page’s
JS scope does not include DevTools compatibility. With this in mind, I have a series of questions:
- Where and how can I use methods like
chrome.devtools.network.getHAR()? I have yet to find where I can run this, as the console when I F12 doesn’t have it in scope.
- Can I automate this process?
- Can I get to this using Selenium specifically, or are there any other browser automation techniques that would work better? (Though I would prefer to avoid PhantomJS because it’s outdated)
- Are there any other easier ways to automate getting a HAR file from a site?
NOTE: My code base is in Python