且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

php爬虫的网站与ajax内容和https

更新时间:2023-02-26 13:35:56

如果你看看这个页面正在做的HTTP请求(例如使用Firebug for Firefox) em>,你会注意到它产生了一些Ajax请求。

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.

一个可能的解决方案可能是你请求其中一个URL

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

返回一些JSON数据,这应该感兴趣你一点;-)

(在JSON之前和之后有一些字符,需要被删除,但除此之外,我没有看到任何不好看的东西。)

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.)