Text from the Html Table tag.
-
Hello Everyone, i am trying to Extract the Contents of the HTML page from the Table Tag. Till now i have done with identifying the Table tag from the Html Page. but still i am not able to extract the data from the table tag. can anyone please help me with this. I am getting the output as 0.
MSHTML::IHTMLDocument2Ptr pDoc;
MSHTML::IHTMLDocument3Ptr pDoc3;
MSHTML::IHTMLElementCollectionPtr pCollection;
MSHTML::IHTMLElementPtr pElement;HRESULT hr = CoCreateInstance(CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER,IID_IHTMLDocument2, (void**)&pDoc);
// psa has the html page contents
hr = pDoc->write(psa);
hr = pDoc->close();pDoc3 = pDoc;
pDoc->get_all(&pCollection);
pCollection = pDoc3->getElementsByTagName("table");BSTR itxt;
for(long i=0; ilength; i++){
pElement = pCollection->item(i, (long)0);
if(pElement != NULL){
m_wndLinksList.AddString((LPCTSTR)bstr_t(pEle->get_innerText(&itxt)));
}
} -
Hello Everyone, i am trying to Extract the Contents of the HTML page from the Table Tag. Till now i have done with identifying the Table tag from the Html Page. but still i am not able to extract the data from the table tag. can anyone please help me with this. I am getting the output as 0.
MSHTML::IHTMLDocument2Ptr pDoc;
MSHTML::IHTMLDocument3Ptr pDoc3;
MSHTML::IHTMLElementCollectionPtr pCollection;
MSHTML::IHTMLElementPtr pElement;HRESULT hr = CoCreateInstance(CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER,IID_IHTMLDocument2, (void**)&pDoc);
// psa has the html page contents
hr = pDoc->write(psa);
hr = pDoc->close();pDoc3 = pDoc;
pDoc->get_all(&pCollection);
pCollection = pDoc3->getElementsByTagName("table");BSTR itxt;
for(long i=0; ilength; i++){
pElement = pCollection->item(i, (long)0);
if(pElement != NULL){
m_wndLinksList.AddString((LPCTSTR)bstr_t(pEle->get_innerText(&itxt)));
}
}NaveenHS wrote:
pCollection = pDoc3->getElementsByTagName("table");
Does
pCollection
have a non-NULL
value?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons