jenni icon indicating copy to clipboard operation
jenni copied to clipboard

.c shouldn't scrape DuckDuckGo HTML

Open auscompgeek opened this issue 11 years ago • 5 comments

The DuckDuckGo API returns calculations perfectly fine...

Moreover, why is it scraping HTML before trying the API?

auscompgeek avatar Apr 03 '15 05:04 auscompgeek

A side effect of attempting to scrape HTML before using the API: if BeautifulSoup isn't installed, it borks completely, where it could potentially get a result.

auscompgeek avatar Apr 06 '15 07:04 auscompgeek

@auscompgeek this is explicitly mentioned in the readme: https://github.com/myano/jenni

kaneda avatar Apr 06 '15 12:04 kaneda

@kaneda Yes, but it causes an exception, so it doesn't even attempt to get a result from the DDG API or from Wolfram|Alpha.

auscompgeek avatar Apr 07 '15 12:04 auscompgeek

The "HTML" is scraped first before the API, because a) many times the "HTML" pages has a simpler answer and b) sometimes it is faster. I believe there was another reason of why I originally did it that way, but I can't remember any other reasons as of now.

myano avatar Apr 29 '15 19:04 myano

Personally, I really wish the google results for .c were more reliable in jenni. They seem/work more reliably when done in a browser.

myano avatar Jul 08 '15 03:07 myano