Created
June 5, 2021 06:04
-
-
Save Jet-C/66d6dfc62fb7e6579dacb6b38df40166 to your computer and use it in GitHub Desktop.
Capture browser requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebDriver driver = new ChromeDriver(options); | |
// Capture all event types | |
proxy.enableHarCaptureTypes(CaptureType.REQUEST_HEADERS, CaptureType.REQUEST_COOKIES, CaptureType.REQUEST_CONTENT, | |
CaptureType.REQUEST_BINARY_CONTENT, CaptureType.RESPONSE_HEADERS, CaptureType.RESPONSE_COOKIES, CaptureType.RESPONSE_CONTENT, | |
CaptureType.RESPONSE_BINARY_CONTENT); | |
// Create HTTP Archive (HAR) file for http tracing. (Script will attempt to capture all m3u8 requests produced from website loading) | |
proxy.newHar("harCapture"); | |
Har har = proxy.getHar(); | |
// Start capture | |
driver.get(websiteUrl); | |
driver.quit(); | |
proxy.stop(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment