Home Java - Web Scrapper Issue
Reply: 1

Java - Web Scrapper Issue

manderson Published in 2018-01-13 05:45:15Z

I'm trying to scrape this page https://www.teamrankings.com/nba/team/cleveland-cavaliers but I need the grid that displays when you click 'Betting View'... I'm having some trouble. Is it even possible with the code I have? I'm getting null when I print div.

    String teamLink = "https://www.teamrankings.com/nba/team/cleveland-cavaliers/.betting"; // + Teams[i] + "/";

    Document doc = Jsoup.connect(teamLink).get();

    final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_45);
    HtmlPage page = webClient.getPage(teamLink);
    final HtmlDivision div = page.getFirstByXPath("div.btn-group");

    page = div.click();
Timberwolf Reply to 2018-01-13 06:01:31Z

There's no need to click the button. The data from both tabs seems to be in both tabs. The button appears to run a JavaScript function that shows and hides columns. Just fetch the whole table with ID DataTables_Table_0 and trash the columns you don't care about.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306402 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO