在Python3上使用feedparser访问passwort保护的提要

在Python3上使用feedparser访问passwort保护的提要,python,feedparser,Python,Feedparser,我正在尝试使用feedparser访问passwort保护的提要。根据,可以这样做: import urllib2, feedparser auth = urllib2.HTTPDigestAuthHandler() auth.add_password('DigestTest', 'feedparser.org', 'test', 'digest') d = feedparser.parse('http://feedparser.org/docs/examples/digest_auth.xml

我正在尝试使用feedparser访问passwort保护的提要。根据,可以这样做:

import urllib2, feedparser
auth = urllib2.HTTPDigestAuthHandler()
auth.add_password('DigestTest', 'feedparser.org', 'test', 'digest')
d = feedparser.parse('http://feedparser.org/docs/examples/digest_auth.xml',
                      handlers=[auth])
但是,我使用的是Python 3.8,因此没有可用的urllib2,只有urllib3。我必须做什么才能使身份验证生效

我已经尝试用urllib3简单地替换urllib2,但这不起作用,因为“模块‘urllib3’没有‘HTTPDigestAuthHandler’属性”

我也试着用

from requests.auth import HTTPDigestAuth
auth=HTTPDigestAuth('user', 'pass')
d = feedparser.parse('http://feedparser.org/docs/examples/digest_auth.xml',
                          handlers=[auth])
但我收到一个“TypeError:预期的BaseHandler实例,Get”