当前位置:网站首页>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
边栏推荐
猜你喜欢

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

【论文笔记】Multi-Goal Reinforcement Learning: Challenging Robotics Environments and Request for Research
![[转]MySQL操作实战(三):表联结](/img/70/20bf9b379ce58761bae9955982a158.png)
[转]MySQL操作实战(三):表联结

Fragment addition failed error lookup

小程序直播+電商,想做新零售電商就用它吧!

Web APIs DOM节点

2022年上半年国家教师资格证考试

YOLOv5添加注意力机制

浅谈JVM(面试常考)
![[转]MySQL操作实战(一):关键字 & 函数](/img/b1/8b843014f365b786e310718f669043.png)
[转]MySQL操作实战(一):关键字 & 函数
随机推荐
Research on the value of background repeat of background tiling
【ES实战】ES上的native realm安全方式使用
[trans]: spécification osgi
Under the national teacher qualification certificate in the first half of 2022
A three-dimensional button
xftp7与xshell7下载(官网)
2022年上半年国家教师资格证考试
A preliminary study of sdei - see the essence through transactions
挂起等待锁 vs 自旋锁(两者的使用场合)
远程升级怕截胡?详解FOTA安全升级
被舆论盯上的蔚来,何时再次“起高楼”?
十年不用一次的JVM调用
[sum of two numbers] 169 sum of two numbers II - enter an ordered array
kubeadm系列-02-kubelet的配置和启动
使用Electron开发桌面应用
Haut OJ 1350: choice sends candy
Simple HelloWorld color change
Reverse one-way linked list of interview questions
Use the command character to close the keyboard command of the notebook
Do a small pressure test with JMeter tool


