Replies: 1 comment 2 replies
-
You don't need to include SingleFile as an extension. Here is an example of code showing how to inject SingleFile in the page when using Selenium: https://github.com/gildas-lormeau/single-file-cli/blob/0cb134df0638f8c7f198097d8ff830a16f8b9f9d/back-ends/webdriver-chromium.js |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Probably I met the same problem like this but I didn't understand like DesWurstes:
Call SingleFile from the JS console #820
Describe the bug
I added SingleFile as an extension for Chrome launched by Selenium, but I failed to call it.
More detail
I loaded SingleFile in Chrome launched by Selenium, and I used :
execute_script("singlefile.saveSingleFile('{}')")
But I got an exception like this:
selenium.common.exceptions.JavascriptException: Message: javascript error: singlefile is not defined
I can see the extension in Chrome, but I can't call it in console like the link, if so I would still get this:
Uncaught ReferenceError: singlefile is not defined at <anonymous>:1:38
Where should I fix?
Expected behavior
Expected that Selenium could call SingleFile through
execute_script("singlefile.saveSingleFile('{}')")
, and I could even program path for each .html to save.Enviroment
Beta Was this translation helpful? Give feedback.
All reactions