首页 > 代码库 > HTML文本载入HTMLDocument2进行解析

HTML文本载入HTMLDocument2进行解析

IHTMLDocument2 *pDoc;
IHTMLElementCollection *objAllElement;
HRESULT hr;
CoInitialize(NULL);
hr = CoCreateInstance(CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER,
IID_IHTMLDocument2, (void**)&pDoc);
SAFEARRAY* psa = SafeArrayCreateVector(VT_VARIANT, 0, 1);
VARIANT *param;
bstr_t bsData = http://www.mamicode.com/(LPCTSTR)pBuffer;//wchar_t *pBuffer;页面源码>

至此html文件已经载入HTMLDocument2,解析代码参考上一篇:《利用WebBrowser控件实现百度自动搜索