Search returns quite small number of results for Multiple Word QueriesSee original GitHub issue
Hello again Mr. Stoilov.
I am stuck in yet another issue involving the function
Pinterest.search() in Pinterest.py starting from Line 368. I have tried with both branches, the master branch as well as the
Single Word Query
boards_query_result = pinterest.search(scope='boards', query='hello')
returns 250 boards, which is all good. The result is the same as the one returned by the UI. https://www.pinterest.com/search/boards/?q=hello&rs=typed&term_meta=hello|typed
But in case of double word query:
Double Word Query
boards_query_result = pinterest.search(scope='boards', query='hello world')
returns only 23 boards. Whereas, the expected results should have been: https://www.pinterest.de/search/boards/?q=hello world&rs=typed&term_meta=hello|typed&term_meta=world|typed
Any idea what might be the issue here? Or what might I be doing wrong this time 😄
Cheers and as always your help is very much appreciated. Thank you.
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
The issue was in my logic for escaping the multi word queries…
query = "%20".join(terms) breaks two things:
- the bookmark key becomes ‘word1%20word2’ and the next bookmark is never loaded, this means that even if there were more results they would never be retrieved
- the query parameter in the options object send to pinterest should be “word1 word2” and not “word1%20word2” and this was making it being treated a a single word.
I am addressing this in thei PR: https://github.com/bstoilov/py3-pinterest/pull/24
Can you also check if I missed something?
Great I will merge the PR then, glad to be of help