Giter VIP home page Giter VIP logo

dictionary_crawler's Introduction

Art by:Altered Artichoke

Dictionary Crawler

This is a python code based on Scrapy package to crawl famous online dictionaries like Oxford, Longman, Cambridge, Webster, and Collins. Be aware that this code is published on July 21, 2019, and if those sites will be updated in future this code may not work properly.

Prerequisites

Scrapy python package

How to use it?

1- set words:

at dictionary_crawler/dictionary_crawler/dictionary_crawler/spiders there is a _init_.py and there is a list named words that is initialize like this:

words = ['I', 'hope', 'you', 'like', 'this', 'dictionary', 'web', 'crawler']

you can change this list to crawl the words that you want.

2- run:

go to the file dictionary_crawler/dictionary_crawler/dictionary_crawler/spiders and run this in the terminal

scrapy crawl [name of dictionary] -o [name of file to write into].jl

for example for Oxford dictionary:

scrapy crawl oxford -o oxford.jl

and the data will be stored in oxford.jl at dictionary_crawler/dictionary_crawler/dictionary_crawler/spiders

How is the output?

The output is a JSON Lines file format that each line of it is a python dict with a word and definitions of it. for example the word hope in the Websted dictinary is like this:

{"hope":
    {
    "verb": ["to cherish a desire with anticipation  to want something to happen or be true"],
    "noun": ["to desire with expectation of obtainment or fulfillment", "to expect with confidence", "city in southwestern Arkansas that was the childhood home of President Bill Clinton population 10,095"],
    "biographical name": ["desire accompanied by expectation of or belief in fulfillment", "expectation of fulfillment or success", "someone or something on which hopes are centered", "something desired or hoped (see  1) for", "Anthony", "Bob 1903–2003 originally Leslie Townes Hope American (British-born) comedian"],
    "geographical name": ["Victor Alexander John 1887–1951 2nd Marquis of", "British soldier; viceroy of India (1936–43)"]
    }
}

Author

  • Peyman Mohseni kiasari

License

This project is licensed under the MIT License - see the LICENSE.md file for details

dictionary_crawler's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.