def parse_unordered_list_polish(self, ulist):
for li in ulist.find_all('li'):
if not isinstance(li, Tag):
continue
if not li.get_text() == '':
text = li.get_text().split(':')
lang_name = text[0]
lang_code = ''
if len(text) > 1:
trans_list = re.split(COMMA_OR_SEMICOLON, text[1])
for trans in trans_list:
translation = remove_parenthesis(trans).strip()
yield (translation, lang_name, lang_code)
parse_pl.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录