This commit is contained in:
St.Huang 2018-07-26 20:28:46 +08:00
parent 344f50f655
commit ca41b686e6

View File

@ -38,14 +38,14 @@ class Baidu_Chinese(WebService):
if element: if element:
tag = element.find_all('div', {'class': 'tab-content'}) tag = element.find_all('div', {'class': 'tab-content'})
if tag: if tag:
result['basicmean'] = u''.join(str(x) for x in tag) result['basicmean'] = u''.join(str(x).decode('utf-8') for x in tag)
#详细释义 #详细释义
element = soup.find('div', id='detailmean-wrapper') element = soup.find('div', id='detailmean-wrapper')
if element: if element:
tag = element.find_all('div', {'class': 'tab-content'}) tag = element.find_all('div', {'class': 'tab-content'})
if tag: if tag:
result['detailmean'] = u''.join(str(x) for x in tag) result['detailmean'] = u''.join(str(x).decode('utf-8') for x in tag)
#英文翻译 #英文翻译
element = soup.find('div', id='fanyi-wrapper') element = soup.find('div', id='fanyi-wrapper')