From 08869f70322d8417c81a03998bd7184d6e58d5df Mon Sep 17 00:00:00 2001 From: Oleg Belousov Date: Mon, 19 Dec 2016 03:31:13 +0200 Subject: [PATCH] Update opengraph.py --- opengraph/opengraph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opengraph/opengraph.py b/opengraph/opengraph.py index 9cedb97..24a687e 100644 --- a/opengraph/opengraph.py +++ b/opengraph/opengraph.py @@ -55,7 +55,7 @@ def parser(self, html): """ """ if not isinstance(html,BeautifulSoup): - doc = BeautifulSoup(html) + doc = BeautifulSoup(html, 'html.parser') else: doc = html ogs = doc.html.head.findAll(property=re.compile(r'^og')) @@ -123,4 +123,4 @@ def scrape_url(self, doc): def scrape_description(self, doc): tag = doc.html.head.findAll('meta', attrs={"name":"description"}) result = "".join([t['content'] for t in tag]) - return result \ No newline at end of file + return result