@ Override public Event parseDocument ( Document doc ) { Event event = new Event ( ) ; event . setSherdogUrl ( ParserUtils . getSherdogPageUrl ( doc ) ) ; //getting name Elements name = doc . select ( ".header .section_title h1 span[itemprop=\"name\"]" ) ; event . setName ( name . html ( ) . replace ( "<br>" , " - " ) ) ; Elements date = doc . select ( ".authors_info .date meta[itemprop=\"startDate\"]" ) ; //TODO: get date to proper format try { event . setDate ( ParserUtils . getDateFromStringToZoneId ( date . first ( ) . attr ( "content" ) , ZONE_ID ) ) ; } catch ( DateTimeParseException e ) { logger . error ( "Couldn't parse date" , e ) ; } getFights ( doc , event ) ; Element org = doc . select ( ".header .section_title h2 a" ) . get ( 0 ) ; SherdogBaseObject organization = new SherdogBaseObject ( ) ; organization . setSherdogUrl ( org . attr ( "abs:href" ) ) ; organization . setName ( org . select ( "span[itemprop=\"name\"]" ) . get ( 0 ) . html ( ) ) ; event . setOrganization ( organization ) ; return event ; }
parses an event from a jsoup document