URL https:“..”使用时无法获取页面内容
问题描述:
我使用mfc active x控件并导航网址。 因为url是https:“...”所以我无法获得页面的内容。URL https:“..”使用时无法获取页面内容
以下是我使用的代码。
m_cstrURL = L"https:\\......" like that
m_webBrowser.Navigate(m_cstrURL.operator LPCWSTR(), NULL, NULL, NULL, NULL);
IHTMLDocument2 *document = (IHTMLDocument2 *)m_webBrowser.get_Document() ;
HRESULT hresult = document->get_body(&iSource);
if(iSource)
{
iSource->get_innerText(&btsrSource);
strSource=btsrSource.m_str;
}
因此,如果url包含https:我的get_body
失败。 我的意思是isource is null ..
答
是Gabor,由于写错了。 反正谢谢你参加我的问题。 我刚刚找到了解决方案。 我使用错误的事件处理程序作为,NavigateComplete2而是我使用DocumentComplete。 它正在工作....
对不起,但这有点难以理解。为什么你使用'https:\'?它应该是'https://'。 – 2014-11-21 12:54:00