用于从Python中获取Web信息的解析器

时间:2013-04-04 08:31:39

标签: python html html-parsing

我的任务是解析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),所以我不知道如何进行解析。

1 个答案:

答案 0 :(得分:1)

查看此库:BeautifulSoup

及其Documentation

最适合您的要求。

干杯!

相关问题