diff --git a/src/fastwq/service/dict/yahoo.py b/src/fastwq/service/dict/yahoo.py index 4d20e1a..7ea1f47 100644 --- a/src/fastwq/service/dict/yahoo.py +++ b/src/fastwq/service/dict/yahoo.py @@ -21,11 +21,11 @@ class Yahoo_Dict(WebService): 'phon': '', 'def': '', 'audio_url': '', + 'detail': '', } # 基本 - element = soup.find( - 'div', class_='dd cardDesign dictionaryWordCard sys_dict_word_card') + element = soup.find('div', class_='dd cardDesign dictionaryWordCard sys_dict_word_card') if element: # 音标 tag = element.find('div', class_='compList ml-25 d-ib') @@ -42,6 +42,13 @@ class Yahoo_Dict(WebService): result['def'] = u'
' + \ str(tag.find('ul')).decode('utf-8') + u'
' + # 释义 + tag = soup.find('div', class_='grp grp-tab-content-explanation tabsContent tab-content-explanation tabActived') + if tag: + result['detail'] = u'
' + \ + str(tag.find('ul')).decode('utf-8') + u'
' + + return self.cache_this(result) def _get_field(self, key, default=u''): @@ -84,3 +91,10 @@ class Yahoo_Dict(WebService): if val is None or val == '': return '' return self._css(val) + + @export(u'详细释义') + def fld_detail(self): + val = self._get_field('detail') + if val is None or val == '': + return '' + return self._css(val) diff --git a/src/fastwq/service/static/_yahoo.css b/src/fastwq/service/static/_yahoo.css index 1a50fc1..2caf4e9 100644 --- a/src/fastwq/service/static/_yahoo.css +++ b/src/fastwq/service/static/_yahoo.css @@ -63,6 +63,10 @@ ul, menu, dir { font-size: 14px; } +.dd .fz-16, .fz-16 { + font-size: 16px; +} + .dd .fl-l, .fl-l { float: left; }