当前位置:网站首页>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
边栏推荐
- Pointnet++的改进
- Gbase database helps the development of digital finance in the Bay Area
- SDEI初探-透过事务看本质
- kubeadm系列-02-kubelet的配置和启动
- Haut OJ 1352: string of choice
- Zheng Qing 21 ACM is fun. (3) part of the problem solution and summary
- win10虚拟机集群优化方案
- Bubble sort summary
- [turn]: Apache Felix framework configuration properties
- Merge sort
猜你喜欢

A new micro ORM open source framework

YOLOv5-Shufflenetv2

《动手学深度学习》学习笔记
![[turn to] MySQL operation practice (I): Keywords & functions](/img/b1/8b843014f365b786e310718f669043.png)
[turn to] MySQL operation practice (I): Keywords & functions

Use of snippets in vscode (code template)

C language Essay 1
![[turn to] MySQL operation practice (III): table connection](/img/70/20bf9b379ce58761bae9955982a158.png)
[turn to] MySQL operation practice (III): table connection

Introduction to tools in TF-A

Web APIs DOM节点

2022年上半年国家教师资格证考试
随机推荐
Haut OJ 1241: League activities of class XXX
[allocation problem] 455 Distribute cookies
利用HashMap实现简单缓存
Optimization scheme of win10 virtual machine cluster
十年不用一次的JVM调用
[转]:Apache Felix Framework配置属性
[turn]: Apache Felix framework configuration properties
Developing desktop applications with electron
To the distance we have been looking for -- film review of "flying house journey"
[binary search] 34 Find the first and last positions of elements in a sorted array
lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: meta line 6 and head, line 8, column 8
Gbase database helps the development of digital finance in the Bay Area
Haut OJ 1357: lunch question (I) -- high precision multiplication
Double pointer Foundation
Do a small pressure test with JMeter tool
High precision subtraction
[es practice] use the native realm security mode on es
【论文笔记】Multi-Goal Reinforcement Learning: Challenging Robotics Environments and Request for Research
[turn to] MySQL operation practice (I): Keywords & functions
Django reports an error when connecting to the database. What is the reason


