Hello,
I cannot get an https to return a print statement for HTML. Http works fine, but when I change the url to https nothing returns besides my "failed" statement from the code. I've had others say this code works fine with https, so it could be a setting issue, etc.
Using Mac OS, Kivy 1.10.1, Python 3.7
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
from kivy.network.urlrequest import UrlRequest
from functools import partial
class MainApp(App):
def build(self):
grid = GridLayout(cols=1)
button1 = Button(text="Press to say Hello",
on_release=self.run_Hello)
button2 = Button(text="Kivy UrlRequest",
on_release=self.run_UrlRequests)
blank_button = Button(text="Click me!")
grid.add_widget(button1)
grid.add_widget(button2)
grid.add_widget(blank_button)
return grid
def run_Hello(self, *args):
print("Hello")
def run_UrlRequests(self, *args):
for i in range(10):
self.r = UrlRequest("https://www.google.com",
on_success=partial(self.update_label, i),
on_error=partial(self.error_label, i))
def update_label(self, i, *args):
print(i)
print("success")
print(self.r.result)
def error_label(self, i, *args):
print("failed")
print(i)
print(self.r.result)