我正在尝试使用httpwebrequest来获取稳定的数据,该数据不会每秒更改一次。
但是当我试图获取一个计时器(实际上你知道它每秒都会变化)时,我没有获取时间数据。我认为这是因为我试图从html文档中获取它,但是当我检查页面源代码时我看到了
<td class="desc ausbau">Yükselt <span class="level">Kademe 7</span>
</td>
</tr>
<tr class="data">
<td class="desc">Süre:</td>
</tr>
<tr class="data">
<td class="desc timer">
<span id="Countdown">Yükleniyor...</span>
</td>
</tr>
<tr class="data">
<td colspan="2">
Yükleniyor... =正在加载...
我认为发生这种情况是因为javascript在html文档完成时启用了自身,而真正的数据在javascript中计算分钟和秒,如下面的屏幕截图所示...
这是我正在使用的代码块...
System.Net.CookieContainer myCookies = new System.Net.CookieContainer();
bool result = HttpMethods.Post("https://lobby-api.ogame.gameforge.com/users", postData, "https://tr.ogame.gameforge.com/", myCookies);
Console.WriteLine("Giris Basarili!");
string mySrc = HttpMethods.Get("https://lobby-api.ogame.gameforge.com/users/me/loginLink?id=103960&server[language]=tr&server[number]=157", "https://lobby.ogame.gameforge.com/tr_TR/?language=tr", myCookies);
string token = GetBetween(mySrc, "token=", "\"}"); // Sayfa kaynağından token kodunu ayıkladık.
string veri = "https://s157-tr.ogame.gameforge.com/game/lobbylogin.php?id=103960&token=" + token + ""; //Tokenli Link
string mySrc2 = HttpMethods.Get(veri, "https://lobby.ogame.gameforge.com/tr_TR/?language=tr", myCookies); //Tokenli Link ile giriş.
Console.WriteLine(mySrc2); // Aldığımız sonucu konsola yazdık
这里有动态计时器数据正在尝试获取,但是每次都失败了,因为它没有给我JavaScript数据。有什么方法可以从中获取动态数据吗?