用python3.8的webview 写一个demo,加载访问https://gd.189.cn/TS/页面内容,并且获取打印页面内容数据
这是 openai写的代码,运行会报错
import webview
def on_load(webview):
# 加载页面完成时的回调函数
print(webview.get_current_url()) # 打印当前页面的 URL
print(webview.get_html()) # 打印当前页面的 HTML 内容
if __name__ == '__main__':
webview.create_window("Demo", "https://gd.189.cn/TS/", on_load=on_load)
webview.start()