用IdHTTP下載某些網站無法成功 |
尚未結案
|
brook
資深會員 發表:57 回覆:323 積分:371 註冊:2002-07-12 發送簡訊給我 |
我要下載日本股市的資料,http://stocks.finance.yahoo.co.jp/stocks/detail/?code=1332
但會出現eof was observed that violates the protocol的錯誤訊息 不知要往哪方面測?,我用的是bcb2010版. [code cpp] 請在此區域輸入程式碼 TMemoryStream *Ms = new TMemoryStream(); if (Ms) { IdHTTP1->IOHandler = IdSSLIOHandlerSocketOpenSSL1; /* 這個可正常執行 IdSSLIOHandlerSocketOpenSSL1->SSLOptions->Method = sslvSSLv23; IdHTTP1->Get("https://finance.yahoo.com/quote/^DJI/history?p=^DJI",Ms); Ms->SaveToFile("C:\\1.HTM"); */ /* IdHTTP1->Request->ContentType = L"text/xml"; IdHTTP1->Request->CharSet = "UTF-8"; IdHTTP1->HandleRedirects = true; IdSSLIOHandlerSocketOpenSSL1->SSLOptions->Method = sslvSSLv23; IdSSLIOHandlerSocketOpenSSL1->SSLOptions->Method = sslvTLSv1; IdSSLIOHandlerSocketOpenSSL1->SSLOptions->Method = sslvTLSv1; IdSSLIOHandlerSocketOpenSSL1->SSLOptions->Method = sslvSSLv2; IdSSLIOHandlerSocketOpenSSL1->SSLOptions->Method << sslvTLSv1; IdSSLIOHandlerSocketOpenSSL1->SSLOptions->Method << sslvSSLv23; IdSSLIOHandlerSocketOpenSSL1->SSLOptions->Method << sslvSSLv2; IdSSLIOHandlerSocketOpenSSL1->SSLOptions->Method << sslvTLSv1 << sslvSSLv23 << sslvSSLv2 << sslvSSLv3; IdHTTP1->IOHandler->DefStringEncoding = TIdTextEncoding::ASCII; //ANSI,ASCII,UTF8 AnsiString GetURL = IdHTTP1->URL->URLEncode(L"http://p1.930t.com/FindLRC.asp?LRCFile=倩女幽魂 - 张国荣.lrc"); IdHTTP1->Request->UserAgent = "stocks.finance.yahoo.co.jp"; */ IdHTTP1->HandleRedirects = true; IdSSLIOHandlerSocketOpenSSL1->SSLOptions->Method = sslvSSLv23; IdHTTP1->Get("http://stocks.finance.yahoo.co.jp/stocks/detail/?code=1332",Ms); Ms->SaveToFile("C:\\1.HTM"); delete Ms; } [/code] |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |