我正在嘗試使用Watin來自動化soundclouds API,因爲我需要將一系列用戶標識轉換爲用戶名。Watin HTML源不更新
我得到的json結果在IE中顯示的很好,瀏覽器正按照計劃循環。
我可以得到html.tostring()並將它寫入第一個用戶的100%文件。但是,當循環繼續時,html.tostring()似乎不會更新,只是複製第一個用戶數據。 (請記住,實際的瀏覽器通過用戶循環罰款)
IE ie = new IE();
while (counter <= counterMax)
{
ie.GoTo("http://api.soundcloud.com/users/" + counter + ".json?client_id=YOUR_CLIENT_ID");
Console.WriteLine(ie.Html.ToString());
System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\path\\" + counter + ".txt");
file.WriteLine(ie.Html.ToString());
file.Close();
counter++;
}
ie.Close();
我無法弄清楚,如果我關閉並重新打開與代碼瀏覽器中它作爲規劃的循環的每次迭代,但這需要我需要使用的數據量太長。
配置文件對象? – CR41G14
似乎很多爲每個用戶創建一個新文件,這是必需的嗎? – CR41G14
我不知道它是如何處理文件對象的,因爲它也在console.writeline()中被複制,無論如何測試都沒有運氣。而新文件不需要使用它,而我試圖解決這個問題。 – loveforfire33