Ich versuche, den folgenden HTML-Code auf einer Seite mit einem Python-Skript zu drucken. Ich folge dem Beispiel hier: https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_progressbarDrucken HTML Progress Bar mit Python
Ich bin nicht in der Lage den folgenden Code an die Arbeit:
from lxml import etree, html
document_root = html.fromstring("<!DOCTYPE html> <html> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <body> <div class="w3-border"> <div class="w3-grey" style="height:24px;width:20%"> </div> </div> </body> </html>")
print(etree.tostring(document_root, encoding='unicode', pretty_print=True))