json - How to programmatically download website sources? -
i need download data feed website:
http://www.oddsportal.com/soccer/argentina/copa-argentina/rosario-central-racing-club-hnmq7geq/
in chrome using developer tools able find link
http://fb.oddsportal.com/feed/match/1-1-hnmq7geq-1-2-yj45f.dat
which contains need. question how programmatically (preferably in java) second link when know first.
thanks in advance useful help.
this quite similar issue. can use string sources. search string find you're looking for. can this.
first start chromedriver , navigate page wish scrap.
webdriver driver = new chromedriver(); driver.get("http://www.oddsportal.com/soccer/argentina/copa-argentina/rosario-central-racing-club-hnmq7geq/");
then download sources string
string scripttoexecute = "var performance = window.performance || window.mozperformance || window.msperformance || window.webkitperformance || {}; var network = performance.getentries() || {}; return network;"; string netdata = ((javascriptexecutor) driver).executescript(scripttoexecute).tostring();
and search string desired link
netdata = netdata.substring(netdata.indexof("fb.oddsportal"), netdata.indexof(".dat")+4); system.out.println(netdata);
Comments
Post a Comment