Expose titleFinder to allow providing your own #104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All selectors (
titleSelector,linkSelector,snippetSelector,resultStatsSelector,cursorSelector) where exposed via the config object passed togoogleIt(). For some reason,titleFinderwas not exposed, which did not allow changing it to adapt the html parser to a new Google Search page structure.In this PR I exposed
titleFinderin the same way as all selectors were. Now, you can change all parameters allowing you to parse the updated Google Search page.Something to look out for:
Build libcommit - me runningnpm run build, but looks like it reformats a lot of unrelated code. Different version of Babel? Let me know how to proceed.getResultstest fails. For some reason, thegetResultsfunction in the test returns 0 results. Meanwhile,googleIt()works fine when using the library itself. This test was failing even before my changes, so something must have been broken prior.Please consider merging changes in Exposed titleFinder to allow providing your own since they fix functionality of this library. Sometimes Google returns a new style of the search page, so it is important to provide your own selectors and
titleFinder.