I’m very new in Python. How to use BeautifulSoup and lxml together?
It is recommended to use lxml as parser in beautifulsoup website
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()
You specify the parser when you call the
BeautifulSoup()constructor: