fastai / course22

The fast.ai course notebooks
https://course.fast.ai
2.39k stars 934 forks source link

To fix duckduckgo_search compatibility issues #109

Open tom5610 opened 7 months ago

tom5610 commented 7 months ago

Using class DDGS rather than calling ddg functions directly.

review-notebook-app[bot] commented 7 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Fernandes2692 commented 3 months ago

THANK YOU!

PranithChowdary commented 1 month ago

@tom5610 the code is perfect bro. you can even enhance it as below so the learner can understand it easily

from duckduckgo_search import DDGS
from fastcore.all import *

def search_images(term, max_images): 
    return L(DDGS().images(keywords=term, max_results=max_images)).itemgot('image')
urls = search_images("birds",100)
urls[0]
wardu commented 2 weeks ago

I just came here to make this exact pull request! Fix works