jar = cookielib.FileCookieJar('cookies')
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(jar))
request = urllib.request.Request('url for authentication', data)
opener.open(request)
How can I send a URL request to the server with Python without actually opening my browser ("without using the webbrowser module")?