Simple duckduckgo results scraping
Switch branches/tags
Nothing to show
Clone or download
thibauts Merge pull request #1 from chrissherlock/https
duckduckgo has moved to https now
Latest commit bb790ea Apr 30, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore first commit Dec 6, 2012
MANIFEST first commit Dec 6, 2012
README.rst fix doc code blocks Dec 6, 2012
ddg first commit Dec 6, 2012
duckduckgo.py duckduckgo has moved to https now Apr 28, 2016
setup.py first commit Dec 6, 2012

README.rst

duckduckgo.py

duckduckgo.py is a simple python module to scrape the duckduckgo search results. The install script will also make available a ddg command line utility that can be conveniently used in a shell pipeline.

A word of warning

This code is intended as a demonstration and, as all scraping utilities, should be used with great caution. By default the code will pause a few milliseconds each time it yields a result to avoid overloading the DDG servers.

Usage

It can be used as a python module

>>> import duckduckgo
>>> for link in duckduckgo.search('duckduckgo', max_results=10):
...     print link
...
https://duckduckgo.com/
https://en.wikipedia.org/wiki/DuckDuckGo
https://duckduckgo.com/about.html
[...]

Or as a command line tool

$ ddg -n 10 duckduckgo

Installation

$ python setup.py install