firefox-devtools / har-export-trigger

Trigger HAR export any time directly from within a page.
https://addons.mozilla.org/en-US/firefox/addon/har-export-trigger/
Mozilla Public License 2.0
55 stars 16 forks source link

WebDriver Promise not Resolving #23

Open AbbadV opened 6 years ago

AbbadV commented 6 years ago

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.

vasinkd commented 5 years ago

I guess you should launch geckodriver with argument --devtools and set option "devtools.toolbox.selectedTool" to "netmonitor" as mentioned here