简体   繁体   中英

Using jsoup to extract specific cell of table

I am trying to use jsoup to extract specific cell of table. I have this code

Element vystraha = doc.select("#hzs-table > tbody > tr").get(oblast).select("td").get(1);

"oblast" is set to 0. So if I understand it correctly this should find table (element) with id "hzs-table" then move to its tbody then to first tr (or second if I set "oblast" to 1) and then select second cell of this row. However compiler shows indexOutOfBounds exception on get(oblast). Table that I am trying to extract is here http://www.hzs.sk/aktualne-informacie/podmienky-na-horach/

Thanks in forward

该表的ID为hzs_table (用下划线而不是减号!)尝试:

Element vystraha = doc.select("#hzs_table > tbody > tr").get(oblast).select("td").get(1);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM