Skip to content

Commit

Permalink
Fixed issue #160
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeVlg committed Dec 15, 2015
1 parent ea95f09 commit 6b494af
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions grab/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import codecs
from datetime import datetime
import time
from lxml.html import HTMLParser
from lxml.etree import XMLParser, parse, ParserError
from selection import XpathSelector
import six
from six.moves.urllib.parse import urlsplit, parse_qs, urljoin
Expand Down Expand Up @@ -288,9 +290,6 @@ def tree(self):
return self.build_html_tree()

def _build_dom(self, content, mode):
from lxml.html import HTMLParser
from lxml.etree import XMLParser, parse

assert mode in ('html', 'xml')
if mode == 'html':
if not hasattr(THREAD_STORAGE, 'html_parser'):
Expand All @@ -307,8 +306,6 @@ def _build_dom(self, content, mode):


def build_html_tree(self):
from lxml.etree import ParserError

from grab.base import GLOBAL_STATE

if self._lxml_tree is None:
Expand Down

0 comments on commit 6b494af

Please sign in to comment.