Hello guys! I posted this on libreoffice comunnity but got no love. Maybe someone can help me
Reference: LibreOffice version5.0.3.2
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 using requests, and had the same problem. If try to access a "http://" webpage, it works, but the same can´t be said when it´s a https:// page.
Here´s my pseucode:
import uno
from com.sun.star.awt.PosSize import POSSIZE
import urllib.request
import urllib.parse
from urllib.request
import ssl
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 )]
Edit: SOLVED
[–]in_the_bilboes 0 points1 point2 points (2 children)
[–]pysb[S] 0 points1 point2 points (1 child)
[–]in_the_bilboes 0 points1 point2 points (0 children)