0

サービスからPNRステータス(列車チケットステータス情報)を取得しようとしています

有効なPNRのリクエスト

リクエスト形式:http ://www.mmtstraintimings.in/pnrstatus/ {PNR番号}

有効なPNRを持つサービスURL:http://www.mmtstraintimings.in/pnrstatus/8102874012

応答 :

Journey Details<\/td>\u000a<\/tr>\u000a<TR class=\"heading_table\">\u000a<td width=\"11%\">Train Number<\/Td>\u000a<td width=\"16%\">Train Name<\/td>\u000a<td width=\"18%\">Boarding Date <br>(DD-MM-YYYY)<\/td>\u000a<td width=\"7%\">From<\/Td>\u000a<td width=\"7%\">To<\/Td>\u000a<td width=\"14%\">Reserved Upto<\/Td>\u000a<td width=\"21%\">Boarding Point<\/Td>\u000a<td width=\"6%\">Class<\/Td>\u000a<\/TR>\u000a<TR>\u000a<TD class=\"table_border_both\">*19309<\/TD>\u000a<TD class=\"table_border_both\">GNC INDORE EXP <\/TD>\u000a<TD class=\"table_border_both\"> 3- 6-2012<\/TD>\u000a<TD class=\"table_border_both\">BRC <\/TD>\u000a<TD class=\"table_border_both\">INDB<\/TD>\u000a<TD class=\"table_border_both\">INDB<\/TD>\u000a<TD class=\"table_border_both\">BRC <\/TD>\u000a<TD class=\"table_border_both\"> SL<\/TD>\u000a<\/TR>\u000a<\/TABLE><table class='listings' border='0' id='listings'><tbody>\u000a<TR>\u000a<td width=\"25%\" class=\"heading_table_top\">S. No.<\/td>\u000a<td width=\"45%\" class=\"heading_table_top\">Booking Status <br \/> (Coach No , Berth No., Quota)<\/td>\u000a<td width=\"30%\" class=\"heading_table_top\">* Current Status <br \/>(Coach No , Berth No.)<\/td>\u000a<\/TR>\u000a<TR>\u000a<TD class=\"table_border_both\"><B>Passenger 1<\/B><\/TD>\u000a<TD class=\"table_border_both\"><B>W\/L 112,PQWL <\/B><\/TD>\u000a<TD class=\"table_border_both\"><B>W\/L 92<\/B><\/TD>\u000a<\/TR>\u000a<TR>\u000a<TD class=\"table_border_both\"><B>Passenger 2<\/B><\/TD>\u000a<TD class=\"table_border_both\"><B>W\/L 113,PQWL <\/B><\/TD>\u000a<TD class=\"table_border_both\"><B>W\/L 93<\/B><\/TD>\u000a<\/TR>\u000a<TR>\u000a<td class=\"heading_table_top\">Charting Status<\/td>\u000a<TD colspan=\"3\" align=\"middle\" valign=\"middle\" class=\"table_border_both\"> CHART NOT PREPARED <\/TD>\u000a<\/TR>\u000a<TR>\u000a<td colspan=\"4\"><font color=\"#1219e8\" size=\"1\"><b> * Please Note that in case the Final Charts have not been prepared, the Current Status might upgrade\/downgrade at a later stage.<\/font><\/b><\/Td>\u000a<\/TR>\u000a<\/TABLE>\u000a<BR>\u000a<TABLE wi

これはHTMLまたはJSONの応答ですか、それとも何ですか?私はそれを得ることができません。

情報を取得するためにHttpPOSTを使用していると思います。

このサービスリンクを使用しているWebサイトhttp://www.pnrstatuscheck.in/この形式で情報を表示します

上記の応答は、この画像としてWebサイトに表示されます

情報をエンティティに抽出して、好きなように使用したいと思います。どうすればよいですか。

任意のポインタが役立ちます

編集

私は上記のテキストを取得するための小さなプログラムを作成しました(私はまだそれを解釈する方法を理解できません)

プロキシを使用していない場合は、プロキシコードを削除してください

        Uri uri = new Uri("http://www.mmtstraintimings.in/pnrstatus/8102874012");
        var request = (HttpWebRequest)WebRequest.Create(uri);
        request.Proxy = WebRequest.DefaultWebProxy;
        request.Credentials = new NetworkCredential("ID", "pass", "domain");
        request.Proxy.Credentials = new NetworkCredential("id", "pass", "domain");
        request.Method = "GET";
        request.ContentType = "application/x-www-form-urlencoded";

        using (var response = request.GetResponse())
        {

            using (Stream responseStream = response.GetResponseStream())
            {
                using (StreamReader readStream = new StreamReader(responseStream, Encoding.UTF8))
                {
                    var result = readStream.ReadToEnd();
                }

            }
        }
4

1 に答える 1

0

あなたのために応答を少し整理しました。

これで何をしたいのかわかりませんが、応答が完全ではないため、解析することさえできません..

また、XML と JSON の両方を受け入れる型として GET 要求を使用して、Fiddler でこれをテストしました。変わりはない。

            "Journey Details</td>
</tr>

<TR class="heading_table">
    <td width="11%">Train Number</Td>
    <td width="16%">Train Name</td>
    <td width="18%">Boarding Date <br>(DD-MM-YYYY)</td>
    <td width="7%">From</Td>
    <td width="7%">To</Td>
    <td width="14%">Reserved Upto</Td>
    <td width="21%">Boarding Point</Td>
    <td width="6%">Class</Td>
</TR>
<TR>
    <TD class="table_border_both">*19309</TD>
    <TD class="table_border_both">GNC INDORE EXP </TD>
    <TD class="table_border_both"> 3- 6-2012</TD>
    <TD class="table_border_both">BRC </TD>
    <TD class="table_border_both">INDB</TD>
    <TD class="table_border_both">INDB</TD>
    <TD class="table_border_both">BRC </TD>
    <TD class="table_border_both"> SL</TD>
</TR>

<table class='listings' border='0' id='listings'>
    <tbody>
        <TR>
            <td width="25%" class="heading_table_top">S. No.</td>
            <td width="45%" class="heading_table_top">Booking Status <br /> (Coach No , Berth No., Quota)</td>
            <td width="30%" class="heading_table_top">* Current Status <br />(Coach No , Berth No.)</td>
        </TR>
        <TR>
            <TD class="table_border_both"><B>Passenger 1</B></TD>
            <TD class="table_border_both"><B>W/L  112,PQWL  </B></TD>
            <TD class="table_border_both"><B>W/L   91</B></TD>
        </TR>
        <TR>
            <TD class="table_border_both"><B>Passenger 2</B></TD>
            <TD class="table_border_both"><B>W/L  113,PQWL  </B></TD>
            <TD class="table_border_both"><B>W/L   92</B></TD>
        </TR>
        <TR>
            <td class="heading_table_top">Charting Status</td>
            <TD colspan="3" align="middle" valign="middle" class="table_border_both"> CHART NOT PREPARED </TD>
        </TR>
        <TR>
            <td colspan="4">
                <font color="#1219e8" size="1">
                    <b> * Please Note that in case the Final Charts have not been prepared, the Current Status might upgrade/downgrade at a later stage.</font></b>
            </Td>
        </TR>
    </TABLE>
    <BR>
    <TABLE wi"
于 2012-05-30T11:32:24.120 に答える