我正在寻找一个 pom.xml 配置,它将我的应用程序打包在一个 jar 中,并将所有应用程序依赖项打包在另一个 jar 中。我查看了 maven-assembly-plugin,通过以下配置,我能够构建一个应用程序 jar,然后构建一个包含所有依赖项的应用程序 jar,但我需要依赖项 jar 不包含我的应用程序:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<finalName>${project.artifactId}-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
谢谢
我正在尝试获取在 PyQT5 QWebEngineView 中加载的页面的 HTML。这是一个简单的例子:
import sys
from PyQt5.QtCore import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtWidgets import *
def callback_function(html):
print(html)
def on_load_finished():
web.page().runJavaScript("document.getElementsByTagName('html')[0]", callback_function)
app = QApplication(sys.argv)
web = QWebEngineView()
web.load(QUrl("https://stackoverflow.com"))
web.show()
web.loadFinished.connect(on_load_finished)
sys.exit(app.exec_())
Run Code Online (Sandbox Code Playgroud)
我希望能够从 runJavaScript() 调用返回 html,但我在回调函数中得到一个空白。
我的代码中有什么不正确的地方以及哪些替代方法可用于获取页面的 HTML?