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

Django reports an error when connecting to the database. What is the reason

JVM call not used once in ten years

Yolov5 ajouter un mécanisme d'attention

Count sort

lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: meta line 6 and head, line 8, column 8
![[interval problem] 435 Non overlapping interval](/img/a3/2911ee72635b93b6430c2efd05ec9a.jpg)
[interval problem] 435 Non overlapping interval

Fragment addition failed error lookup

Yolov5 adds attention mechanism

利用HashMap实现简单缓存

Embedded database development programming (VI) -- C API
随机推荐
[轉]: OSGI規範 深入淺出
第六章 数据流建模—课后习题
[to be continued] [UE4 notes] L1 create and configure items
Romance of programmers on Valentine's Day
服务熔断 Hystrix
[turn to] MySQL operation practice (I): Keywords & functions
Shell Sort
Reverse one-way linked list of interview questions
[转]:Apache Felix Framework配置属性
使用Room数据库报警告: Schema export directory is not provided to the annotation processor so we cannot expor
A three-dimensional button
A new micro ORM open source framework
Acwing 4301. Truncated sequence
浅谈JVM(面试常考)
Page countdown
Optimization scheme of win10 virtual machine cluster
Zzulioj 1673: b: clever characters???
Grail layout and double wing layout
Count sort
对象的序列化

