【发布时间】:2012-11-08 17:52:03
【问题描述】:
我是 Python 的新手。 BeautifulSoup和lxml如何搭配使用?
beautifulsoup website中推荐使用lxml作为解析器
def get_html():
from bs4 import BeautifulSoup
import lxml
soup = BeautifulSoup(open("http://www.google.com"));
#print(soup.prettify());
print(soup.title);
if __name__ == '__main__':
get_html()
【问题讨论】:
标签: python html-parsing beautifulsoup lxml