1
This is an screenshot of siteJsoup HTML代碼解析
我用下面的代碼
@Override
protected Void doInBackground(Void... params) {
try {
Connection.Response baglanilan = Jsoup.connect("http://www.eshot.gov.tr/tr/UlasimSaatleri/288")
.method(Connection.Method.GET)
.execute();
Document document = Jsoup.connect("http://www.eshot.gov.tr/tr/UlasimSaatleri/288").data("hatId","581").cookies(baglanilan.cookies()).post();
Elements bakiye = document.select("#frmDuraklar > ul > li");
veri1ad = bakiye.toString();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
progressDialog.dismiss();
tvveri.setText(veri1ad);
}
代碼獲得:
<li class="ring" id="10504">Fahrettin Altay</li>
<li class="ring" id="10507">İkinci Oyak Sitesi</li>
<li class="ring" id="10505">Ordu Pazarı</li>
<li class="ring" id="10506">Mehmetçik</li>
.
.
.
我需要的結果只有ID列表。我如何解析一個id列表?
什麼反應「bakiye」? –