def _get_commented_CDN_tags(self):
def get_comment(s):
return s if isinstance(s, Comment) and '//' in s and s.strip()[:4] in ['<lin', '<scr'] else ''
comments = bs(self._get_template()).find_all(string=get_comment)
tags = self._unitags(bs(str(comments)).select('link[href*="//"], script[src*="//"]'))
if tags:
for tag in tags:
for comment in comments:
if tag['open'] in comment and tag['ref'] in comment:
tag['comment'] = comment
return tags
评论列表
文章目录