<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta id="viewport" name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0, maximum-scale=2.0" />
<link rel="icon" sizes="any" mask href="https://h5.sinaimg.cn/upload/2015/05/15/28/WeiboLogoCh.svg" color="black">
我的一段文本是这样的,我想将开头的<?xml version="1.0" encoding="UTF-8"?>删除掉
于是我在python中写了
sss = re.sub("<?xml version='1.0' encoding='UTF-8'?>","",html)
print(sss)
可是我发现没有效果?应该怎么写呢?
qq_遁去的一_1
相关分类