class Visitor(object):
def Visit(self, value):
print("This is the HTML source:")
print(value)
class LoadHandler(object):
def OnLoadingStateChange(self,browser,is_loading,**_):
if not is_loading:
pass
def OnLoadEnd(self,browser,frame,http_code):
''''加载完成 打印结果'''
sv = Visitor();
frame.GetSource(sv);
print "end";
先上代码了。 我在CEF加载完毕事件后,想得到页面html,但一直没得到结果,为什么?求解
Must keep a strong reference to the StringVisitor object during the visit.
change:
to: