我尝试在网页中搜索包含'ä‘字符的文本,bs4不能正确编码这些字符,因此我无法正确搜索站点。例如 <a href="/gy/area/name/1208.html">täkäen</a>
soup.findAll(text='täkäen') - does not worksoup.findAll(text='/gy/area/name
BeautifulSoup(xml_string, "lxml") # BeautifulSoup parses the data strings where the XML is converted to Unicode("invention-title"), soup.findAll("doc-number"), assign.find("orgname"), soup.findAll("date"), soup.find
我正在从一个网站上抓取一些数据,我可以使用下面提到的代码这样做:import urllib2import time
from bs4 import BeautifulSoupspamwriter.writerow([time.strftime("%Y-%m-%d"),time.strftime("%B"),time.strftime("%A") ,unicode(oem.string).encode('utf8')