我的任务是解析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)相当复杂,所以我不知道如何进行解析。
发布于 2013-04-04 17:47:28
看看这个库:BeautifulSoup
及其Documentation
它最适合您的需求。
干杯!
https://stackoverflow.com/questions/15806187
复制相似问题