简体   繁体   English

从 ajax 刮取数据

[英]Scrape data from ajax

I'm trying to scrape from https://www.goaloong.net/我正在尝试从https://www.goaloong.net/

This my first goal:这是我的第一个目标:

在此处输入图像描述

I need to have all the live events, excluded next and finished matches.我需要所有的现场赛事,排除下一场和结束的比赛。

My difficulty is to extract only the data I need and find the live event time.我的困难是只提取我需要的数据并找到实时事件时间。 I need this data: ID-START TIME-LEAGUE-HOME-AWAY-SCORE-TIME我需要这些数据:ID-START TIME-LEAGUE-HOME-AWAY-SCORE-TIME

This data are here https://www.goaloong.net/gf/data/bf_us.js .这个数据在这里https://www.goaloong.net/gf/data/bf_us.js

Can you offer me some help please?你能给我一些帮助吗?

Thanks谢谢

UPDATE:更新:

Added vba code添加了 vba 代码

Sub get_test()

Dim objHTML As HTMLDocument
Dim objElement As Object
Set objHTML = New HTMLDocument
    Url = "https://www.goaloong.net/gf/data/bf_us.js"
With CreateObject("MSXML2.XMLHTTP")
    .Open "GET", Url, False
    .Send
    objHTML.body.innerHTML = .ResponseText
End With

a = objHTML.body.innerHTML
   
Row = Split(a, ";")

leng = UBound(Row) - LBound(Row)
For n = 2 To leng
Cells(n, 1) = Row(n)
Next n

End Sub

Here is an overview of the datafields in array A. I have all 35 fields included, but 17 are unnown what they are for.这是数组 A 中数据字段的概述。我包含了所有 35 个字段,但其中 17 个字段不知道它们的用途。 Among other things, you should be able to see from the descriptions how you can calculate the correct playing time.除其他事项外,您应该能够从描述中看到如何计算正确的播放时间。 For this you need the values 6 and 7 depending on the value 8. You can calculate with the given times no matter in which time zone a match takes place, because it is sufficient if all given times refer to the same time zone.为此,您需要值 6 和 7,具体取决于值 8。无论匹配发生在哪个时区,您都可以使用给定时间进行计算,因为如果所有给定时间都参考同一个时区就足够了。

You can split the JS by CrLf into its rows:您可以通过CrLf将 JS 拆分为其行:

splitAllJsRows = Split(.ResponseText, Chr(13))

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM