标签:os html ar htm amp res har log
void GetHtmlContent() { //m_Explorer HRESULT hr; LPDISPATCH pDisp; IHTMLDocument2* phd;//IHtmlDocument2接口指针 IHTMLElement* pBody;//网页中的元素 pDisp = m_Explorer.get_Document(); hr = pDisp->QueryInterface(IID_IHTMLDocument2, (LPVOID*)&phd); pDisp->Release(); if (SUCCEEDED(hr)) { BSTR bstrText; hr = phd->get_body(&pBody); //BODY if (SUCCEEDED(hr)) { hr = pBody->get_innerText(&bstrText); if (SUCCEEDED(hr)) { //PrintBSTR(bstrText); // 处理得到的文本 char* lpszText2 = _com_util::ConvertBSTRToString(bstrText); g_Log.print(LogLevel_Info,"[info] GetHtmlContent:%s.\n",lpszText2); SysFreeString(bstrText); //AfxMessageBox("获取成功"); } } SysFreeString(bstrText); } phd->Release(); pBody->Release(); }
标签:os html ar htm amp res har log
原文地址:http://blog.csdn.net/loveheronly/article/details/38172487