index += 1
else:
index += 1
else:
index += 1
然后我须要在该文件上运行 sortlist.py
,因为 ls
办法的排序与 Python 不合。 我本来可以在这些文件上运行比较脚本,但我更愿意以可视方法进行操作。 最后,我成功找到了 42 个图像,这些图像没有来自文档的 HTML 引用。
这是我的完全解析脚本:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# parseimg4.py
import os
def imagefound(all_text, imagelist, index):
end = 0
index += 2
newimage = ''
while end == 0:
if (all_text[index] != '"'):
newimage = newimage + all_text[index]
index += 1
else:
newimage = newimage + '\n'
imagelist.append(newimage)
end = 1
return
推荐阅读
沙龙晃荡 | 3月31日 京东、微博、华为拭魅战专家与你合营商量容器技巧实践! 2015年,固执的苹不雅也推出了带压力感应的手写笔,然则迄今为止,这个笔如今只能在iPad Pro上应用,这让苹不雅>>>详细阅读
本文标题:如何用Python解析HTML?
地址:http://www.17bianji.com/lsqh/40963.html
1/2 1