def getImageUrlList(url): stream = getStream(url) data = getCodingContent(stream) parser = MyParser() parser.feed(data) alist = parser.scriptList longestStr = longestString(alist) var_img = cutTo(longestStr, ';') return getImageUrlFromScript(var_img)
def searchResult(url): parser = MyParser() parser.feed(getCodingContent(getStream(url))) block = longestString(parser.scriptList) parser.close() pattern = re.compile('(?<="listNum":)\d*(?=,)') count = pattern.findall(block) if count: count = int(count[0]) return count return 0