Fix bug that imports cambridge data-src-mp3 failed

This commit is contained in:
Javan Zhu 2019-01-13 11:55:07 +08:00
parent daf3d82c31
commit 7dc4953db2

View File

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