<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Sorry, I was very busy and I couldn't see the mail list.<br><br>Finally I fixed the error, it was my fault. As you say I should use webkit_dom_document_get_elements_by_tag_name() insted of webkit_dom_element_get_elements_by_tag_name(). But I had other problem, I didn't wait until webpage load finish. <br><br>I explain my problem at StackOverflow and there explain the solution. It can useful for other people so I put the link:<br><br><a href="http://stackoverflow.com/questions/20123619/webkit-dom-element-get-elements-by-tag-name-doesnt-work-properly" target="_blank">http://stackoverflow.com/questions/20123619/webkit-dom-element-get-elements-by-tag-name-doesnt-work-properly</a><br><br>Thanks everyone.<br><br><div>> Subject: Re: [webkit-gtk] webkit_dom_element_get_elements_by_tag_name doesn't        work properly<br>> From: cgarcia@igalia.com<br>> To: angelluispg89@hotmail.com<br>> CC: webkit-gtk@lists.webkit.org<br>> Date: Fri, 13 Dec 2013 11:03:46 +0100<br>> <br>> El jue, 21-11-2013 a las 20:25 +0100, Ángel Luis escribió:<br>> > I am trying to print name of nodes from DOM with WebKitGTK with the<br>> > following code:<br>> <br>> Sorry for the late reply, I haven't had time to look at this problem<br>> until now. <br>> <br>> > WebKitDOMDocument *dom = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(webView));<br>> > WebKitDOMNodeList* video = webkit_dom_element_get_elements_by_tag_name(dom, "*");<br>> <br>> This line is wrong, WebKitDOMDocument is not a WebKitDOMElement, you<br>> should use webkit_dom_document_get_elements_by_tag_name() instead. What<br>> WebKitGTK+ version are you using? because recent versions will give a<br>> runtime error when passing the wrong DOM object to a method.<br>> <br>> > <br>> > gulong element_count = webkit_dom_node_list_get_length(video);<br>> > int i = 0;<br>> > for (i = 0; i < element_count; i++)<br>> > {<br>> > WebKitDOMNode *element = webkit_dom_node_list_item(video, i);<br>> > printf("tag: %s\n",webkit_dom_node_get_node_name (element));<br>> > <br>> > }<br>> > <br>> > <br>> > And I have the following webpage:<br>> > <br>> > <!DOCTYPE html><br>> > <html><br>> > <head><br>> > </head><br>> > <body><br>> > <video id="video" autoplay preload="none" width="320"<br>> > height="240"><br>> > <source src="./movie.ogg" type="video/ogg"> <br>> > Your browser does not support the video tag.<br>> > </video><br>> > <video id="video2" width="320" height="240" autoplay<br>> > preload="none"> <br>> > <source src="./movie.ogg" type="video/ogg"><br>> > Your browser does not support the video tag. <br>> > </video><br>> > <input type="hidden" id="prueba" name="finish" value="false"><br>> > </body><br>> > </html><br>> <br>> I have a added this as a test case to WebKit2 DOM bindings tests, see<br>> bug:<br>> <br>> https://bugs.webkit.org/show_bug.cgi?id=125686<br>> <br>> > <br>> > <br>> > And the output of my program is: <br>> > <br>> > tag: HTML<br>> > tag: HEAD<br>> > tag: BODY<br>> > <br>> > I don't understand why it output that, the output should be:<br>> > <br>> > tag: HTML<br>> > tag: HEAD<br>> > tag: BODY<br>> > tag: VIDEO<br>> > tag: SOURCE<br>> > tag: VIDEO<br>> > tag: SOURCE<br>> > tag: INPUT<br>> <br>> I'm getting this.<br>> <br>> > Anyone know what's happend?<br>> <br>> No idea, maybe it was because you were using the wrong method.<br>> <br>> > Thanks<br>> > <br>> > <br>> > _______________________________________________<br>> > webkit-gtk mailing list<br>> > webkit-gtk@lists.webkit.org<br>> > https://lists.webkit.org/mailman/listinfo/webkit-gtk<br>> <br>> -- <br>> Carlos Garcia Campos<br>> http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xF3D322D0EC4582C3<br></div>                                            </div></body>
</html>