fix some potential problem now
parent
39340c2c3b
commit
2546508a01
|
@ -358,7 +358,7 @@ def parser_beautiful(innerHTML, article, number, dircrea, bk=False):
|
||||||
linksite = chi.attrs['href']
|
linksite = chi.attrs['href']
|
||||||
if linksite:
|
if linksite:
|
||||||
linksite = linksite.replace("//link.zhihu.com/?target=https%3A", "").replace("//link.zhihu.com/?target=http%3A", "")
|
linksite = linksite.replace("//link.zhihu.com/?target=https%3A", "").replace("//link.zhihu.com/?target=http%3A", "")
|
||||||
if article[-1]=='\n':
|
if len(article) > 0 and article[-1]=='\n':
|
||||||
article += "["+chi.text+"]"+"("+linksite + ")"
|
article += "["+chi.text+"]"+"("+linksite + ")"
|
||||||
else:
|
else:
|
||||||
article += "\n\n["+chi.text+"]"+"("+linksite + ")"
|
article += "\n\n["+chi.text+"]"+"("+linksite + ")"
|
||||||
|
|
Loading…
Reference in New Issue