Open
Description
Describe the bug
ENGINE FAILURE: Bing
raise NoResultsOrTrafficError(
search_engine_parser.core.exceptions.NoResultsOrTrafficError: The result parsing was unsuccessful. It is either your query could not be found or it was flagged as unusual traffic
I tried the example from readme page. gsearch and bsearch all raise the same error.
the ysearch throw a different error:
line 61, in parse_single_result
rdict["descriptions"] = desc.text
AttributeError: 'NoneType' object has no attribute 'text'
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
braindevices commentedon Jan 25, 2022
my ip is not blocked by any of those search engines. I try to debug a little bit by output the url and html with following code:
The url is
https://www.google.com/search?start=0&q=python+google+search+api&gbv=1&hl=en
And I found the resulting html from get_source() saying:
So it seems like you need to confirm something and save some cookie before you could go on.
braindevices commentedon Jan 25, 2022
bingsearch only works once per 5 to 8 trials. no idea why though.
neithere commentedon Aug 26, 2022
Looks like the consent cookie should be set, e.g. like this: https://stackoverflow.com/a/70560365/68097
Unfortunately the lib doesn't seem to be configurable in this aspect. The
cookies
argument should be passed toaiohttp.ClientSession()
inCacheHandler.get_source()
: https://github.com/bisohns/search-engine-parser/blob/master/search_engine_parser/core/utils.py#L78FYI, I've added a very crude workaround here: a537f4e
Obviously a proper implementation should add an engine-dependent set of default cookies or something in this vein.
Add workaround for Google consent page