"Http://www.baidu.com", browserSettings); How to get the CefRefPtr< after; CefDOMDocument> Document), to obtain a great god help
void DomVisitTestor: : TestModify (CefRefPtrThe document)
{
OutputDebugStringW (L "DomVisitTestor: : TestModify \ r \ n");
CefRefPtrBodyNode=document - & gt; GetBody ();
If (bodyNode - & gt; The HasChildren ())
{
CefRefPtrChildNode=bodyNode - & gt; GetFirstChild ();
Would be szLog [512]={0};
Do {
Swprintf_s (szLog, 256, L "node name - % s, tagName - type - % d, % s value - % s \ r \ n",
ChildNode - & gt; GetName (). ToWString (.) c_str (),
ChildNode - & gt; GetElementTagName (). ToWString (.) c_str (),
ChildNode - & gt; GetType (), childNode - & gt; GetValue ());
OutputDebugStringW (szLog);
If (childNode - & gt; IsElement () & amp; & ChildNode - & gt; GetElementTagName ()=="H1"
& & ChildNode - & gt; GetElementAttribute (" id ")=="hello")
{
CefRefPtrTextNode=childNode - & gt; GetFirstChild ();
Swprintf_s (szLog, 512, L found "hello, text - % s \ r \ n", textNode - & gt; GetValue (). ToWString (.) c_str ());
OutputDebugStringW (szLog);
TextNode - & gt; SetValue (" Hello World Modified!" );
break;
}
} while ((childNode=childNode - & gt; GetNextSibling ()). The get ());
}
CefRefPtrHello=document - & gt; GetElementById (" hello ");
If (hello. The get ())
{
Hello - & gt; SetElementAttribute (" align ", "center");
OutputDebugStringW (L "Change hello align \ r \ n");
}
}