-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incomplete parsing using myhtml_node_next and myhtml_node_text #157
Comments
@parser12 hi! ```HTML and for C code: See Creating and highlighting code blocks Thanks! |
After parsing, you get this tree: <html>
<head>
<body>
<span class="c3">
"
"
<span class="sonne" title="Sonnenscheindauer">
<img width="20" height="20" src="whatever1.img" alt="sun">
"0.0 h"
"
"
<span class="regen" title="Niederschlagsmenge">
<img width="20" height="20" src="whatever2.img" alt="rain">
"0 mm"
"
"
"
" This is a new line after the "
" subNode1 = myhtml_node_child(node);
while (subNode1 != NULL) {
printf("child: %s\n", myhtml_tag_name_by_id(subNode1->tree, myhtml_node_tag_id(subNode1), NULL));
if (myhtml_node_tag_id(subNode1) == MyHTML_TAG__TEXT) {
printf("Text: %s\n", myhtml_node_text(subNode1, NULL));
}
subNode1 = myhtml_node_next(subNode1);
} Output:
I think the general meaning is clear? For your task, see function for search nodes and example. P.S.: you can use Modest and selectors for this. |
Thank you for the really fast response. |
Hi
I am using myhtml to parse following html code
I expect to get: the 0.0h and 0 mm
my understaning of the tree is:
tag:span class c3
I use:
node: span with class c3
subnode1: the tags span, img and the required text
pseudo code:
the compete source code is attached as well as the html file
I am able to parse e.g. the tags span class=regen, the img with it's attributes but not the text: "0 mm"
do you havea suggestion?
The text was updated successfully, but these errors were encountered: