import requests from urllib.parse import quote from cishu.cishubase import cishubase import re class weblio(cishubase): def search(self, word): url = "https://www.weblio.jp/content/" + quote(word) x = requests.get(url, proxies=self.proxy).text x = re.sub("", "", x) _all = [] _xx = re.findall('
([\\s\\S]*?)
', x) for xx in _xx: xx = re.sub("", "", xx) xx = re.sub("", "", xx) xx = re.sub('class="(.*?)"', "", xx) _all.append(xx) join = "
".join(_all) return join