当前位置:网站首页>lxml. etree. XMLSyntaxError: Opening and ending tag mismatch: meta line 6 and head, line 8, column 8
lxml. etree. XMLSyntaxError: Opening and ending tag mismatch: meta line 6 and head, line 8, column 8
2022-07-05 05:24:00 【Star and Dream Star_ dream】
Python Reptiles Problems encountered in :
Python Code ( There's nothing wrong with it , yes HTML There is a problem with the document )
from lxml import etree # Access to the local HTML file html = etree.parse(r" test .html") result = etree.tostring(html, encoding='utf-8').decode('utf-8') print(result)HTML file ( Error message )
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>etree Of parse Method </title> </head> <body> <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> <li>6</li> <li>7</li> <li>8</li> <li>9</li> <li>10</li> </ul> </body> </html>
Solution :
Focus on modifying this part
After modification :
<meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />Add “/” Number
Successful execution :
End
边栏推荐
- [allocation problem] 135 Distribute candy
- Add level control and logger level control of Solon logging plug-in
- object serialization
- Under the national teacher qualification certificate in the first half of 2022
- The next key of win generates the timestamp file of the current day
- [转]MySQL操作实战(一):关键字 & 函数
- room数据库的使用
- 嵌入式数据库开发编程(零)
- Demonstration of using Solon auth authentication framework (simpler authentication framework)
- [to be continued] [depth first search] 547 Number of provinces
猜你喜欢

Ue4/ue5 illusory engine, material part (III), material optimization at different distances
![[turn to] MySQL operation practice (III): table connection](/img/70/20bf9b379ce58761bae9955982a158.png)
[turn to] MySQL operation practice (III): table connection

object serialization

Optimization scheme of win10 virtual machine cluster

Collapse of adjacent vertical outer margins

嵌入式数据库开发编程(零)
![[to be continued] [UE4 notes] L3 import resources and project migration](/img/81/6f75f8fbe60e037b45db2037d87bcf.jpg)
[to be continued] [UE4 notes] L3 import resources and project migration

Merge sort

Stm32cubemx (8): RTC and RTC wake-up interrupt

TF-A中的工具介绍
随机推荐
Heap sort summary
Magnifying glass effect
Fragment addition failed error lookup
Haut OJ 1357: lunch question (I) -- high precision multiplication
Zzulioj 1673: b: clever characters???
A three-dimensional button
Shell Sort
Ue4/ue5 illusory engine, material chapter, texture, compression and memory compression and memory
二十六、文件系统API(设备在应用间的共享;目录和文件API)
Solon Logging 插件的添加器级别控制和日志器的级别控制
[转]: OSGI规范 深入浅出
Under the national teacher qualification certificate in the first half of 2022
Find a good teaching video for Solon framework test (Solon, lightweight application development framework)
Use the command character to close the keyboard command of the notebook
The present is a gift from heaven -- a film review of the journey of the soul
[转]MySQL操作实战(三):表联结
C语言杂谈1
十年不用一次的JVM调用
Merge sort
National teacher qualification examination in the first half of 2022


