我有几行代码试图与jsoup建立连接:
public static void main(String[] args) throws UnknownHostException, IOException{
new Test();
}
public Test(){
new Worker().execute();
}
class Worker extends SwingWorker<Integer, Integer>{
protected Integer doInBackground() throws Exception{
while(true){
...
Connection.Response con = Jsoup.connect(URL)
.method(org.jsoup.Connection.Method.GET)
.userAgent(USER_AGENT)
.timeout(100000)
.execute();
...
}
...
}
}
但是当它到达“execute()”部分时,我的整个程序就停止了。有什么问题吗?
谢谢您
暂无答案!
目前还没有任何答案,快来回答吧!