リモートサイトのボタンクリックイベントを発生させ、その後ページのすべてのhtmlコードを取得するのを手伝ってください
HttpWebRequest を使用してすべてのデータを取得できることはわかっていますが、クリック イベントを発生させる方法がわかりません。
私はこのコードを見つけます:
`HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create("url");
httpRequest.Method = "POST";
httpRequest.ContentType = "application/x-www-form-urlencoded";
byte[] bytedata = Encoding.UTF8.GetBytes(poststring);
httpRequest.ContentLength = bytedata.Length;
Stream requestStream = httpRequest.GetRequestStream();
requestStream.Write(bytedata, 0, bytedata.Length);
requestStream.Close();
HttpWebResponse httpWebResponse =
(HttpWebResponse)httpRequest.GetResponse();
Stream responseStream = httpWebResponse.GetResponseStream();
StringBuilder sb = new StringBuilder();
using (StreamReader reader =
new StreamReader(responseStream, System.Text.Encoding.UTF8))
{
string line;
while ((line = reader.ReadLine()) != null)
{
sb.Append(line);
}
}
`