{"action":"opened","issue":{"url":"https://api.github.com/repos/scrapy/parsel/issues/40","repository_url":"https://api.github.com/repos/scrapy/parsel","labels_url":"https://api.github.com/repos/scrapy/parsel/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/scrapy/parsel/issues/40/comments","events_url":"https://api.github.com/repos/scrapy/parsel/issues/40/events","html_url":"https://github.com/scrapy/parsel/issues/40","id":160564698,"number":40,"title":"Selector.root is not an instance of lxml.html.HtmlElement even if parser is html","user":{"login":"kmike","id":107893,"avatar_url":"https://avatars.githubusercontent.com/u/107893?v=3","gravatar_id":"","url":"https://api.github.com/users/kmike","html_url":"https://github.com/kmike","followers_url":"https://api.github.com/users/kmike/followers","following_url":"https://api.github.com/users/kmike/following{/other_user}","gists_url":"https://api.github.com/users/kmike/gists{/gist_id}","starred_url":"https://api.github.com/users/kmike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmike/subscriptions","organizations_url":"https://api.github.com/users/kmike/orgs","repos_url":"https://api.github.com/users/kmike/repos","events_url":"https://api.github.com/users/kmike/events{/privacy}","received_events_url":"https://api.github.com/users/kmike/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-16T02:29:49Z","updated_at":"2016-06-16T02:29:49Z","closed_at":null,"body":"I'm trying to use lxml.Cleaner without parsing response multiple times:\r\n\r\n```py\r\nfrom lxml.html.clean import Cleaner\r\ncleaner = Cleaner()\r\nsel = parsel.Selector(\"<html><body><style>.p {width:10px}</style>hello</body></html>\"\r\ncleaner.clean_html(sel.root)\r\n```\r\n\r\nThis doesn't work because Cleaner needs a `lxml.html.HtmlElement` instance, while Selector.root is always `lxml.etree._Element`, so it doesn't have a required `.rewrite_links` method.\r\n\r\nWhy is lxml.etree.HtmlParser [used](https://github.com/scrapy/parsel/blob/fde9087b3bbc8adf54ad25b9ea68874054adaec2/parsel/selector.py#L20) for html and not lxml.html.HtmlParser?"}}
{"actor":{"display_login":"kmike"}}