I'm guessing the D-Link is using Basic Authentication. In that case you may use this code from the documentation in order to get the through the login.
import urllib.request
# Create an OpenerDirector with support for Basic HTTP Authentication...
auth_handler = urllib.request.HTTPBasicAuthHandler()
auth_handler.add_password(realm='D-Link', uri=url, user=username, passwd=password)
opener = urllib.request.build_opener(auth_handler)
urllib.request.install_opener(opener)
f = urllib.request.urlopen(url)
print(f.status)
print(f.reason)
print(f.read().decode('utf-8'))