我正在尝试将https url加载到HTMLWindow中
import wx
import wx.html
class MyHtmlFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, -1, title, size=(600,400))
html = wx.html.HtmlWindow(self)
if "gtk2" in wx.PlatformInfo:
html.SetStandardFonts()
wx.CallAfter(html.LoadPage, "https://www.google.com")#Fails to load page
#but the following works ...
#wx.CallAfter(html.LoadPage, "http://www.google.com")#Works Fine!
app = wx.PySimpleApp()
frm = MyHtmlFrame(None, "Simple HTML Browser")
frm.Show()
app.MainLoop()
有没有一种方法可以在HTMLWindow中加载ssl页面(或者其他在a-wxWindow中呈现ssl页面的方式)?在
我使用的是wx2.8.10,升级目前还不是一个真正的选择
我真的很想把我的赏金给别人,但这真的是我的解决办法,我也。。。某种程度上。。。解决方案是使用
wx IEWin
您只需使用现有方法(如
urllib2.urlopen
)下载该文件,并将该文件保存到文件系统,然后将该文件名传递给HtmlWindow的LoadPage方法。在下面的StackOverflow问题HTTPS connection Python 和How do I download a file over HTTP using Python?包含了现有方法的示例
其他更复杂的选项包括在下载或编译Python绑定之后使用wxIE和wxMozilla。在
相关问题 更多 >
编程相关推荐