From 3e53988804280eafcbdaddbf07267e5f4e9e2b5b Mon Sep 17 00:00:00 2001 From: UltralyticsAssistant Date: Mon, 26 Aug 2024 15:52:28 +0200 Subject: [PATCH] Refactor code for speed and clarity --- README.md | 2 +- beautiful_scraper.py | 1 - bing_scraper.py | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 62a4f733..55fef955 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Welcome to the Bing image scraping tool, updated and maintained by Ultralytics. This repository contains updated code originally from [https://github.com/hardikvasa/google-images-download](https://github.com/hardikvasa/google-images-download), enabling users to efficiently scrape and download images from Bing for various applications like machine learning, data analysis, or personal projects. -[![Ultralytics Actions](https://github.com/ultralytics/google-images-download/actions/workflows/format.yml/badge.svg)](https://github.com/ultralytics/google-images-download/actions/workflows/format.yml) Discord Ultralytics Forums +[![Ultralytics Actions](https://github.com/ultralytics/google-images-download/actions/workflows/format.yml/badge.svg)](https://github.com/ultralytics/google-images-download/actions/workflows/format.yml) Discord Ultralytics Forums Ultralytics Reddit ## 🐳 Docker Run diff --git a/beautiful_scraper.py b/beautiful_scraper.py index 8f114175..97b12c30 100644 --- a/beautiful_scraper.py +++ b/beautiful_scraper.py @@ -34,7 +34,6 @@ def download_baidu(word): def download_google(word): """Downloads images from Bing for a given search word by scraping image links and using curl to download.""" - # url = 'https://www.google.com/search?q=' + word + '&client=opera&hs=cTQ&source=lnms&tbm=isch&sa=X&ved=0ahUKEwig3LOx4PzKAhWGFywKHZyZAAgQ_AUIBygB&biw=1920&bih=982' url = f"https://www.bing.com/images/search?q={word}" soup = BeautifulSoup(requests.get(url).text, "html.parser") diff --git a/bing_scraper.py b/bing_scraper.py index 69d6ee6a..fead276c 100644 --- a/bing_scraper.py +++ b/bing_scraper.py @@ -382,6 +382,8 @@ def user_input(): class googleimagesdownload: + """A class for downloading images from Google Images using various search parameters and filters.""" + def __init__(self): """Initializes a googleimagesdownload object to fetch images from Google Images.""" pass