You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed after a while using this library (when I set keep_temp_files=True) that my html_str is being wrapped as if it were just the body. I can see this is being done _prepare_html_string where the parameter is called html_body (which makes it clearer that it's just the body).
Is there any way to stop this wrapping and just pass in the full HTML?
Perhaps with a different argument?
The text was updated successfully, but these errors were encountered:
At the time, I did not consider that html_str would be used with something other than a very basic HTML string; it was more of a convenient way to transform a string into a valid HTML file than anything. But I indeed see cases where you could already have a full HTML file stored as a string and wouldn't want to transform it in any way.
Currently, there is no "right" way to disable this behavior; your workaround is probably the shortest/cleanest way to disable _prepare_html_string.
Another way could be to write your HTML strings to files directly and call the screenshot method using the html_file parameter, as the HTML files are not pre-processed in any way.
In any case, a simple boolean parameter allowing to disable this behavior would be nice; it will be added when I'll have access to my machine.
I noticed after a while using this library (when I set
keep_temp_files=True
) that myhtml_str
is being wrapped as if it were just the body. I can see this is being done_prepare_html_string
where the parameter is calledhtml_body
(which makes it clearer that it's just the body).Is there any way to stop this wrapping and just pass in the full HTML?
Perhaps with a different argument?
The text was updated successfully, but these errors were encountered: