def sources(self, url, hostDict, hostprDict):
try:
sources = []
if url == None: return sources
url = urlparse.urljoin(self.base_link, url)
result = client.request(url)
result = client.parseDOM(result, 'div', attrs={'id': 'links'})
attr = client.parseDOM(result, 'ul', ret='data-type')
result = client.parseDOM(result, 'ul')
for x in range(0, len(result)):
transl_type = attr[x]
links = result[x]
sources += self.extract_sources(transl_type, links)
return sources
except:
return sources
评论列表
文章目录