import sys

from PyQt6.QtCore import QUrl  # 新增导入 QUrl
from PyQt6.QtWebEngineWidgets import QWebEngineView
from PyQt6.QtWidgets import QApplication
from PyQt6.QtWidgets import QMainWindow


def show_webpage(url: str = "https://www.baidu.com"):
    app = QApplication(sys.argv)
    window = QMainWindow()
    window.setWindowTitle("Web Browser")
    window.setGeometry(100, 100, 800, 600)

    web_view = QWebEngineView()
    window.setCentralWidget(web_view)

    web_view.load(QUrl(url))

    window.show()
    sys.exit(app.exec())
