如何将 Web 生成的内容导入 Java 应用程序?

How to Import Web Generated Content Into a Java Application?

我想使用在线 name/description 生成器来使用网站的免费生成器 (http://fantasynamegenerators.com/ancient-greek-names.php#.VRzNuuFSKu8) 为休眠数据库生成数据集,但我不知道如何做调用页面源代码中定义的名称生成函数。我应该如何从 Java 应用程序中执行此操作?能举个例子吗?

尝试的选项之一是将 http://docs.oracle.com/javase/7/docs/api/java/net/URLConnection.html and obtain the source of the page. Then you can fetch or process the content by observing java script functions. Or also you may decide to use inbuilt Nashorn 用于 运行 java 脚本函数。