-
Notifications
You must be signed in to change notification settings - Fork 70
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
firstNodeMatchingSelector return nil when looking for node which exist #61
Comments
Hello! Did your HTML make it into the issue intact? If not, try surrounding it in backticks or triple-backticks to preserve the formatting. Otherwise I'm left to guess at what's going on. Is it possible that it's an Let me know if any of that is helpful, or if I've misunderstood the HTML you're trying to scrape! |
ahh Sorry I didn't notice that my tags are gone ;/ this is my hmtl with tags: I tried to use |
I'm still a bit suspicious that your text is actually HTML. Is it possible it's actually XML, or something else entirely? If you put Additionally, Putting the above two points together, If your document looks (in part) like this: Ahoy <img>there</img> sailor it actually gets parsed as if you wrote this: Ahoy <img />there sailor (See how the "there" popped out of the I hope that all made sense, I realize it's pretty confusing. Can you share the full document you're trying to parse (obfuscating any private data of course)? Maybe I can think of a more suitable tool. |
Thanks for your fast answer
and made some parse to get info from tags "hand" and "image" |
It looks like XML to me, so you could try using Are you saying the current version of HTMLReader parses that text differently from version 0.5.9? If so I should take a look at that, there might be a bug there. |
Hi
I'm trying to parse some HTML document to get two texts from tags:
"Some text to display.image_name_to_display.jpg"
so I use this code :
HTMLDocument *document = [HTMLDocument documentWithString:self.content]; //content is html above
NSString *handAndImageStr = [document firstNodeMatchingSelector:@"hand"].textContent;
if (handAndImageStr) {
NSString *imgStr = [document firstNodeMatchingSelector:@"image"].textContent;
and then imgStr is null instead of "image_name_to_display.jpg"
I'm using HTMLReader 0.9.4
The text was updated successfully, but these errors were encountered: