def _parser(webcontent):
end_tag_count=4
pointer = webcontent.tell()
end = len(webcontent.getvalue())
while pointer<end:
line_curr = webcontent.readline()
found = re.search("Found ([0-9]+) synonym[ a-z]+([0-9]+) group", line_curr, re.UNICODE)
notFound = re.search("<div class=\"no-results\">", line_curr, re.UNICODE)
if found:
groupNum = int(found.group(2))
synonymNum = int(found.group(1))
synonym_list = obtainGroups(webcontent, groupNum)
webcontent.close()
return synonym_list
if notFound:
webcontent.close()
return []
webcontent.close()
return synonym_list
评论列表
文章目录