修复微信改版后正文无法正常显示的问题
This commit is contained in:
parent
cd135b97b4
commit
7e4e77d958
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"jsonDir": "C:/vWeChatFiles/rawlist/tmp1",
|
"jsonDir": "C:/Users/kklwin10/Desktop/Dump-0103-20-14-29",
|
||||||
"htmlDir": "c:/vWeChatFiles/html/",
|
"htmlDir": "c:/vWeChatFiles/html/",
|
||||||
"pdfDir": "c:/vWeChatFiles/pdf/"
|
"pdfDir": "c:/vWeChatFiles/pdf/"
|
||||||
}
|
}
|
||||||
5
start.py
5
start.py
@ -96,6 +96,7 @@ def ChangeImgSrc(htmltxt,saveimgdir,htmlname):
|
|||||||
else :
|
else :
|
||||||
img.attrs["src"] = ""
|
img.attrs["src"] = ""
|
||||||
ChangeCssSrc(bs) #修改link标签
|
ChangeCssSrc(bs) #修改link标签
|
||||||
|
ChangeContent(bs) #修改js_content的style,使正文能正常显示
|
||||||
return str(bs) #将BeautifulSoup对象再转换为字符串,用于保存
|
return str(bs) #将BeautifulSoup对象再转换为字符串,用于保存
|
||||||
|
|
||||||
def ChangeCssSrc(bs):
|
def ChangeCssSrc(bs):
|
||||||
@ -106,6 +107,10 @@ def ChangeCssSrc(bs):
|
|||||||
newhref = "http:" + href
|
newhref = "http:" + href
|
||||||
link.attrs["href"] = newhref
|
link.attrs["href"] = newhref
|
||||||
|
|
||||||
|
def ChangeContent(bs):
|
||||||
|
jscontent = bs.find(id="js_content")
|
||||||
|
jscontent.attrs["style"]=""
|
||||||
|
|
||||||
#文章类
|
#文章类
|
||||||
class Article():
|
class Article():
|
||||||
def __init__(self,url,pubdate,idx,title):
|
def __init__(self,url,pubdate,idx,title):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user