当前位置:网站首页>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
边栏推荐
- Optimization scheme of win10 virtual machine cluster
- A new micro ORM open source framework
- [merge array] 88 merge two ordered arrays
- Simple modal box
- Acwing 4301. Truncated sequence
- [allocation problem] 455 Distribute cookies
- FVP和Juno平台的Memory Layout介绍
- 挂起等待锁 vs 自旋锁(两者的使用场合)
- High precision subtraction
- Kali 2018 full image download
猜你喜欢
Reverse one-way linked list of interview questions
GBase数据库助力湾区数字金融发展
Applet live + e-commerce, if you want to be a new retail e-commerce, use it!
2022年上半年国家教师资格证考试
Learning notes of "hands on learning in depth"
[turn to] MySQL operation practice (I): Keywords & functions
Grail layout and double wing layout
[merge array] 88 merge two ordered arrays
[paper notes] multi goal reinforcement learning: challenging robotics environments and request for research
Embedded database development programming (V) -- DQL
随机推荐
The next key of win generates the timestamp file of the current day
FVP和Juno平台的Memory Layout介绍
【ES实战】ES上的native realm安全方式使用
远程升级怕截胡?详解FOTA安全升级
Haut OJ 1350: choice sends candy
Learning notes of "hands on learning in depth"
Zheng Qing 21 ACM is fun. (3) part of the problem solution and summary
A new micro ORM open source framework
Django reports an error when connecting to the database. What is the reason
使用命令符关闭笔记本自带键盘命令
When will Wei Lai, who has been watched by public opinion, start to "build high-rise buildings" again?
Reverse one-way linked list of interview questions
使用Electron开发桌面应用
lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: meta line 6 and head, line 8, column 8
小程序直播+电商,想做新零售电商就用它吧!
Stm32cubemx (8): RTC and RTC wake-up interrupt
The present is a gift from heaven -- a film review of the journey of the soul
对象的序列化
Haut OJ 1357: lunch question (I) -- high precision multiplication
[to be continued] [UE4 notes] L3 import resources and project migration