여기 내 샘플 코드입니다. 현재 페이지의 html 소스 코드를 얻으려면 어떻게해야합니까? 'GString at 0x8875130'만 출력합니다. 어떻게 그것을 실제 텍스트로 변환 HTML이 포함되어 있습니까?Pygtk WebKit get source html
from gi.repository import WebKit
from gi.repository import Gtk, Gdk
def get_source(webobj, frame):
print "loading..."
x = web.get_main_frame().get_data_source().get_data()
print x
win = Gtk.Window()
web = WebKit.WebView()
web.open("http://google.com")
web.connect("load-finished", get_source)
win.add(web)
win.show_all()
Gtk.main()
굉장합니다. 감사 – Nitheesh