You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And my objc code is:
TFHpple* hpple = [TFHpple hppleWithHTMLData:data];
NSArray* links = [hpple searchWithXPathQuery:@"//a[@href!='']"];
for (TFHppleElement* link in links) {
NSLog(@"link's parent: %@", link.parent);
}
The output shows that the link's parent is nil, while it should be
node in this case. So is this a bug?
The text was updated successfully, but these errors were encountered:
I believe that xPath starts recording at the "a" node. If you had started at the "ul" or "li" node then when you get to the "a" node, parent would contain the "li" node and the "li" node would, in turn, contain a parent as the "ul" node.
my html code is like this:
And my objc code is:
TFHpple* hpple = [TFHpple hppleWithHTMLData:data];
NSArray* links = [hpple searchWithXPathQuery:@"//a[@href!='']"];
for (TFHppleElement* link in links) {
NSLog(@"link's parent: %@", link.parent);
}
The output shows that the link's parent is nil, while it should be
The text was updated successfully, but these errors were encountered: