mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
Don't set parser.encoding
Read-only property with new Beautiful Soup parser.
This commit is contained in:
parent
69d426b36f
commit
4f8c2954cf
3 changed files with 1 additions and 6 deletions
|
|
@ -84,8 +84,6 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
|
|||
handler = linkparse.MetaRobotsFinder()
|
||||
parser = htmlsax.parser(handler)
|
||||
handler.parser = parser
|
||||
if self.charset:
|
||||
parser.encoding = self.charset
|
||||
# parse
|
||||
try:
|
||||
parser.feed(self.get_raw_content())
|
||||
|
|
|
|||
|
|
@ -89,14 +89,13 @@ class FormFinder(object):
|
|||
self.form = None
|
||||
|
||||
|
||||
def search_form(content, cgiuser, cgipassword, encoding='utf-8'):
|
||||
def search_form(content, cgiuser, cgipassword):
|
||||
"""Search for a HTML form in the given HTML content that has the given
|
||||
CGI fields. If no form is found return None.
|
||||
"""
|
||||
handler = FormFinder()
|
||||
parser = htmlsax.parser(handler)
|
||||
handler.parser = parser
|
||||
parser.encoding = encoding
|
||||
# parse
|
||||
parser.feed(content)
|
||||
parser.flush()
|
||||
|
|
|
|||
|
|
@ -125,8 +125,6 @@ def find_links (url_data, callback, tags):
|
|||
# construct parser object
|
||||
handler = linkparse.LinkFinder(callback, tags)
|
||||
parser = htmlsax.parser(handler)
|
||||
if url_data.charset:
|
||||
parser.encoding = url_data.charset
|
||||
handler.parser = parser
|
||||
# parse
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue