Merge pull request #113 from JavanZhu/master

Fix bug that imports cambridge data-src-mp3 failed
This commit is contained in:
sthoo 2019-01-13 16:20:48 +08:00 committed by GitHub
commit 8fc39dea6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,7 @@
#-*- coding:utf-8 -*- #-*- coding:utf-8 -*-
import os import os
import re
from ..base import * from ..base import *
cambridge_url_base = u'https://dictionary.cambridge.org/' cambridge_url_base = u'https://dictionary.cambridge.org/'
@ -37,7 +39,7 @@ class Cambridge(WebService):
if not header_found: if not header_found:
header = element.find('div', class_='pos-header') header = element.find('div', class_='pos-header')
if header: if header:
tags = header.find_all('span', class_='pron-info') tags = header.find_all('span', class_=re.compile("uk|us"))
if tags: if tags:
for tag in tags: for tag in tags:
r = tag.find('span', class_='region') r = tag.find('span', class_='region')