Closed MusienkoAnton closed 1 month ago
Hello, are you trying to use the package or the CLI ?
If you're using the package, you can use the temp_path
parameter like so :
from html2image import Html2Image
hti = Html2Image(temp_path='/your/path/')
...
Thanks I try to use
from html2image import Html2Image
hti = Html2Image(temp_path='/cache/')
...
And get another error on Android:
Traceback (most recent call last):
File "<string>", line 43, in <module>
File "<frozen runpy>", line 229, in run_module
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\sa090\AppData\Local\Temp\serious_python_temp1cde2046\main.py", line 5, in <module>
File "C:\Users\sa090\AppData\Local\Temp\serious_python_temp1cde2046\routes.py", line 5, in <module>
File "C:\Users\sa090\AppData\Local\Temp\serious_python_temp1cde2046\newprereg_view.py", line 13, in <module>
File "C:\Users\sa090\AppData\Local\Temp\serious_python_temp1cde2046\pypackages\html2image\html2image.py", line 106, in init
File "C:\Users\sa090\AppData\Local\Temp\serious_python_temp1cde2046\pypackages\html2image\browsers\chrome.py", line 184, in init
File "C:\Users\sa090\AppData\Local\Temp\serious_python_temp1cde2046\pypackages\html2image\browsers\chromium.py", line 8, in init
File "C:\Users\sa090\AppData\Local\Temp\serious_python_temp1cde2046\pypackages\html2image\browsers\chrome.py", line 192, in executable
File "C:\Users\sa090\AppData\Local\Temp\serious_python_temp1cde2046\pypackages\html2image\browsers\chrome.py", line 158, in _find_chrome
FileNotFoundError: Could not find a Chrome executable on this machine, please specify it yourself.
In this Android I have Chrome Browser
I see. html2image needs a browser executable that can be used in headless mode to take screenshots. I could be mistaken, but I don't this this is possible with a classic install of a Chrome apk. It may be doable if you install the desktop (and not mobile) version of Chrome/Chromium via command line, but I don't know if it is possible.
If this could work at Android it will be great
Hello, I`m try to use html2image in Android apk and have error with rights to use '/tmp' folder. Could you add temp_dir for Android?