问题描述
我试图让Jsoup和Gaelyk一起开展我的Google App Engine实验项目。在我的日常工作中,我和Grails一起工作,所以想象一下,开始和Gaelyk一起玩是一块蛋糕......并不是那么快......
发生错误当我包括:
@Grab('org.jsoup:jsoup:1.9.2')
项目构建。但是,访问我正在执行HTML抓取的页面时,出现此错误:
更新 build.gradle
文件没有多少好处,我使用Glide来构建项目....任何想法都将得到最多赞赏!
build.gradle
file: 插件{
idcom .appspot.glide-gaeversion0.9.3
}
依赖项{
compileorg.jsoup:jsoup:1.9.2
在你的Groovlet中,所有你需要的是:
$ p $ import org.jsoup。*
def doc = Jsoup.connect( http://< your-url-here>).get()
重新开始营业
更新:我添加了一个样本滑翔样本
I am attempting to get Jsoup to work on my Google App Engine experiment project with Gaelyk. I work with Grails at my day job, so figured it would be a piece of cake to start playing with Gaelyk... Not so fast...
The error happens when I include:
@Grab('org.jsoup:jsoup:1.9.2')
Project builds. But, accessing the page where I am doing the HTML scraping I get this error:
Not having much luck updating the build.gradle
file I use with Glide to build the project.... Any ideas would be MOST appreciated!
As you mentioned you are using glide, put this in your build.gradle
file:
plugins {
id "com.appspot.glide-gae" version "0.9.3"
}
dependencies {
compile "org.jsoup:jsoup:1.9.2"
}
In your Groovlet, all you need is:
import org.jsoup.*
def doc = Jsoup.connect("http://<your-url-here>").get()
And you are back in business
Update: I have added a sample Scraper in glide-samples
这篇关于Groovy @Grab生成java.lang.NoClassDefFoundError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!