JSoup屏幕刮痧有很多分区

时间:2013-08-02 11:51:26

标签: android jsoup

我有一个我想用android抓取的页面,并且想要的内容是这样的:

body
div#wrapper
div#mainContentArea
div#scheduleModule
div#scheduleDayView
div#scheduleDayViewScroll 
div#scheduleItemContainer
div#eventContainer
div#SSPP_o090570*A*
div.eventInfo
p.eventText
span.eventInfoDefault

如何使用jsoup访问范围?

1 个答案:

答案 0 :(得分:2)

如果你不想在街头被带走并为你的过犯鞭打,你会在那里拆分那段文字。

无论如何,你想找到class为eventInfoDefault的span?良好:

Document site = Jsoup.connect("http://www.example.com");
Element span = site.select("span.eventInfoDefault").first();
//Proceed to do whatever you want with that below.

来源:http://jsoup.org/cookbook/extracting-data/selector-syntax