har-export-trigger
har-export-trigger copied to clipboard
WebDriver Promise not Resolving
We have the most recent Firefox, most recent geckodriver, most recent har-export-trigger extension and are having trouble getting the Har File for a given webpage. Below is a script we wrote do to the task.
profile = webdriver.FirefoxProfile('path to our default firefox profile') driver = webdriver.Firefox(profile,executable_path="path to gecko driver") driver.execute_script("HAR.triggerExport().then(harLog => { return(harLog);});") driver.get('https://www.aljazeera.com') driver.execute_script('return window.stop') k = driver.execute_script("HAR.triggerExport().then(harLog => { return(harLog);});") print k
We can open Firefox with the addon already installed, but the status of the harlog export is stuck on pending.
I guess you should launch geckodriver with argument --devtools and set option "devtools.toolbox.selectedTool" to "netmonitor" as mentioned here