我尝试用两种方式连接共享点:
#one way
server_url = 'http://*****/'
site_url = server_url + '*****'
opener.open(server_url)
opener = basic_auth_opener(server_url,'****', '******')
#another way
from requests.auth import HTTPBasicAuth
reportReq = requests.get('%s:%d/' % ('http://*******', 80), auth=HTTPBasicAuth('*****', '****'), verify=True)
这是错误:
requests.exceptions.ConnectionError: HTTPConnectionPool(host='***', port=80): (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)