Jsoup not displaying tags using the select() function

Viewed 153

I'm trying to scrape the team win-loss record data from the NBA website here. Here's an image of the lines of text I want to capture, it is circled in black:

enter image description here

Can someone try scraping this exact data and seeing if it works? I've been at it for hours and nothing is working. I was able to scrape the team names and start times but when I try using jsoup's select function on the record lines, I get 0 results back. It's as if the tags are hidden from the html hierarchy. Is this possible? I'm new to this and I may be doing something wrong.

Code I have tried:

Document document = Jsoup.connect("http://espn.go.com/nba/scoreboard/_/date/20160315").get();
            games = document.select("section.sb-score");

            for(Element game : games)
            {
                mHomeTeam = game.select("td.home").select("div.sb-meta").text();
                Elements test = game.select("p.record.overall");
                mAwayTeam = game.select("td.away").select("div.sb-meta").text();
                mHomeTeamRecord = game.select("td.home").select("div.record-container").select("p.record").text();
                mAwayTeamRecord = game.select("td.away").select("div.record-container").select("p.record").text();
                mGameStartTime = game.select("span.time").text();

                Game newGameObj = new Game(mHomeTeam, mAwayTeam, mGameStartTime, mHomeTeamRecord, mAwayTeamRecord);
                mGameList.add(newGameObj);
            }
1 Answers
Related