How to get webcontent that is loaded by JavaScript using cURL?

后端 未结 2 1631
無奈伤痛
無奈伤痛 2020-11-28 07:10

I am trying to grab the score table from a website. The problem is that the site is using javascript that apparently loads on document.ready.

For that r

相关标签:
2条回答
  • 2020-11-28 07:30

    cURL will only get you the markup of the page. It won't load any additional resources or process the page. You probably want to look at something like PhantomJS for this. PhantomJS is a headless WebKit browser. It has its own API that lets you "script" behavior. So you can tell PhantomJS to load the page and dump out the data you need.

    0 讨论(0)
  • 2020-11-28 07:36

    Depending on what exactly you're trying to do, you could just fetch the JSON data that makes the table:

    http://www.opap.gr/web/services/rs/betting/availableBetGames/sport/program/4100/0/sport-1.json?localeId=el_GR

    0 讨论(0)
提交回复
热议问题