Skip to content
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

Fixes #45: add texteq feature #76

Merged
merged 2 commits into from
Dec 6, 2017
Merged

Conversation

ComFreek
Copy link
Contributor

@@ -159,6 +165,27 @@ scrapeIt.scrapeHTML = ($, opts) => {
$elm = $elm.eq(cOpt.eq)
}

if (typpy(cOpt.texteq, Number)) {
let children = $elm.contents();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for contents(), I didn't know cheerio supports it. Will review this soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure whether texteq should also support deep-searching for text nodes from an API standpoint. It would be useful in cases where the actual markup changes often: <div>Blah</div>, <div><b>Blah</b></div>. Just because it got surrounded with a <b>, it shouldn't throw scrape-it off its track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants