我的任务是解析一个HTML页面(用西里尔文)并提取某些单词。下面是我要分析的网页:http://www.toponymic-dictionary.in.ua/。我只看到一页:
import urllib
from lxml.html import fromstring
url = 'http://www.toponymic-dictionary.in.ua/'
content = urllib.urlopen(url).read()
doc = fromstring(content)
doc.make_links_absolute(url)
HTML代码对我来说相当复杂(使用xpath),所以我不知道如何进行解析。在
看看这个库:BeautifulSoup
它的Documentation
它最适合你的要求。在
干杯!在
相关问题 更多 >
编程相关推荐