Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道一点 php,一点 python,而且我在寻找工具方面非常精明,但是我找不到可以解析 htm 文件并返回所有包含“http”的字符串的工具或方法。
我知道有快速修复。任何人?
你可以在python中试试这个:
def grepFileForLines(self, fileName = "", keepLinesWith = ""): fileObj = open(fileName, 'r') matches = [] for line in fileObj: if line.find(keepLinesWith) > -1: matches.append(line) return matches