开发者

php crawler for website with ajax content and https

开发者 https://www.devze.com 2023-03-24 20:15 出处:网络
i\'m trying to grab the content of a website based on ajax 开发者_StackOverflowand https but with no luck.

i'm trying to grab the content of a website based on ajax 开发者_StackOverflowand https but with no luck.

Is this possible.

The website i'm trying to crawl is this:

https://www.bet3000.com/en/html/home.html#!https://www.bet3000.com/html/en/eventssportsbook.html?category_id=2117

Thanks


If you take a look at the HTTP requests that this page is doing (using, for example, Firebug for Firefox), you'll notice it makes several Ajax requests.

Instead of trying to execute the Javascript code, a possible solution could be for you to request one of those URLs, and get the data -- you'd also not have to parse the HTML, this way.


In this specific case, one of those requests is made to the following URL :

https://www.bet3000.com/ajax/en/sportsbook.json.html?category_id=2117&offset=&live=&sportsbook_id=0

This URL seems to return some JSON data, that should interest you quite a bit ;-)
(There is a few characters before and after the JSON, that will need to be removed, but, asides from that, I don't see anything that doesn't look good.)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号