add method to retrieve har

mmalter 2025-02-12 05:09:40 +01:00
parent 8d9ba4d663
commit f2463f84b3
1 changed files with 8 additions and 0 deletions

View File

@ -31,6 +31,13 @@ def install_har_export_trigger(driver):
return driver
def har_data(self):
return self.execute_async_script(
"HAR.triggerExport().then(arguments[0]);"
)
class Grattoir(object):
def __enter__(self):
self._driver = None
@ -45,6 +52,7 @@ class Grattoir(object):
o.binary = binary
self._driver = firefox.webdriver.WebDriver(options=o)
self._driver = install_har_export_trigger(self._driver)
self._driver = har_data
return self._driver
def __exit__(self, exc_type, exc_value, exc_tb):