Reference: LibreOffice Versão: 5.0.3.2
Hello guys!
I´m trying to make a python macro with urllib module to access a https:// website, but it seems SSL was not implemented.
I also tried with requests, and had the same problem. If I use a http:// page, it works, but the same can´t be said when it´s a https:// page.
Here´s my pseucode:
----------[some Codeformatting by karolus]
import uno
from com.sun.star.awt.PosSize import POSSIZE
import urllib.request
import urllib.parse
from urllib.request import urlopen
import os
from os.path import isdir,expanduser
import pickle
import sys
import http.cookiejar
import ssl
import sys
def access_webpage():
with urllib.request.urlopen('https://www.google.com.br') as f:
print(f.read(300))
g_exportedScripts = access_webpage()
the error:
com.sun.star.uno.RuntimeExceptionError during invoking function consulta_CPF in module file:///C:/Program%20Files%20(x86)/LibreOffice%205/share/Scripts/python/CPF.py (<class 'urllib.error.URLError'>: <urlopen error unknown url type: https>
C:\Program Files (x86)\LibreOffice 5\program\python-core-3.3.3\lib\urllib\request.py:1316 in function unknown_open() [raise URLError('unknown url type: %s' % type)]
C:\Program Files (x86)\LibreOffice 5\program\python-core-3.3.3\lib\urllib\request.py:447 in function _call_chain() [result = func(*args)]
C:\Program Files (x86)\LibreOffice 5\program\python-core-3.3.3\lib\urllib\request.py:492 in function _open() ['unknown_open', req)]
C:\Program Files (x86)\LibreOffice 5\program\python-core-3.3.3\lib\urllib\request.py:469 in function open() [response = self._open(req, data)]
C:\Program Files (x86)\LibreOffice 5\program\python-core-3.3.3\lib\urllib\request.py:156 in function urlopen() [return opener.open(url, data, timeout)]
C:\Program Files (x86)\LibreOffice 5\share\Scripts\python\CPF.py:99 in function consulta_CPF() [with urllib.request.urlopen('https://www.google.com.br') as f:]
C:\Program Files (x86)\LibreOffice 5\program\pythonscript.py:869 in function invoke() [ret = self.func( *args )]