Easy to use asynchronous and synchronous DuckDuckGo search engine scraper.
Project description
Asynchronous and Synchronous DuckDuckGo Search Engine Scraper
Scrapes the duckduckgo search engine.
Asynchronous Example
from ddg_scraper import asearch
import asyncio
async def main():
results = await asearch("Python")
async for result in results:
...
asyncio.run(main())
Synchronous Example
from ddg_scraper import search
results = search("Python")
for result in results:
...
In both examples, result
is ddg_scraper.Result
Attributes and Methods of ddg_scraper.Result
Attributes
title
description
url
icon_url
Methods
as_dict()
- Converts the dataclass to a
dict
object and returns it.
- Converts the dataclass to a
How To Install
- Using pip:
pip install ddg-scraper
- Manual:
- Clone the folder somewhere
- CD to the location
- Install the packages listed in
requirements.txt
(pip install -r requirements.txt
) - Copy the folder, ddg_scraper where you want to use it.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ddg_scraper-1.2.tar.gz
(15.1 kB
view hashes)