我的任务是解析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

它最适合您的要求。

干杯!

关于python - 解析器,用于从Python中从Web提取信息,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15806187/

10-16 20:16