har-export-trigger | Trigger HAR export any time directly from within a page | HTTP library
kandi X-RAY | har-export-trigger Summary
kandi X-RAY | har-export-trigger Summary
Trigger HAR export any time directly from within a page.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of har-export-trigger
har-export-trigger Key Features
har-export-trigger Examples and Code Snippets
Community Discussions
Trending Discussions on har-export-trigger
QUESTION
I want to be able to get a body of the specific subrequest using a selenium behind the proxy.
Now I'm using python + selenium + chromedriver. With logging I'm able to get each subrequest's headers but not body. My logging settings:
caps['loggingPrefs'] = {'performance': 'ALL', 'browser': 'ALL'}
caps['perfLoggingPrefs'] = {"enableNetwork": True, "enablePage": True, "enableTimeline": True}
I know there are several options to form a HAR with selenium:
- Use geckodriver and har-export-trigger. I tried to make it work with the following code:
window.foo = HAR.triggerExport().then(harLog => { return(harLog); }); return window.foo;
Unfortunately, I don't see the body of the response in the returning data.
- Use browsermob proxy. The solution seems totally fine but I didn't find the way to make browsermob proxy work behind the proxy.
So the question is: how can I get the body of the specific network response on the request made during the downloading of the webpage with selenium AND use proxies.
UPD: Actually, with har-export-trigger I get the response bodies, but not all of them: the response body I need is in json, it's MIME type is 'text/html; charset=utf-8' and it is missing from the HAR file I generate, so the solution is still missing.
UPD2: After further investigation, I realized that a response body is missing even on my desktop firefox when the har-export-trigger add-on is turned on, so this solution may be a dead-end (issue on Github)
UPD3: This bug can be seen only with the latest version of har-export-trigger. With version 0.6.0. everything works just fine.
So, for future googlers: you may use har-export-trigger v. 0.6.0. or the approach from the accepted answer.
...ANSWER
Answered 2019-Feb-17 at 20:34I have actually just finished to implemented a selenium HAR script with tools you are mentioned in the question. Both HAR getting from har-export-trigger and BrowserMob are verified with Google HAR Analyser.
A class using selenium, gecko driver and har-export-trigger:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install har-export-trigger
Clone or download source code in this repository to your machine.
Launch Firefox Nightly and open about:debugging page
Click Load Temporary Add-on and pick any file from the root source code directory (e.g. manifest.json
Re-open an existing DevTools Toolbox to make sure the extension is properly loaded by Firefox DevTools.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page