Skip to main content

Scraping words from wordreference.com

Project description

wordreference-scraper

Module for scraping words in Wordreference.com, from English to Spanish.

Multiple languages soon.

Usage

'wordreference-scraper' is used to scrape words and its meanings from the online dictionary "Wordreference"

One word

from wordreference_scraper.wordreference_scraper import WordreferenceScraper

words = ['get']

wordreference_scraper_instance = WordreferenceScraper(words)

scraped_words = wordreference_scraper_instance.start()

print(scraped_words)
# Dictionary where the keys are the forms of the word
# and the value is the html of all meanings of that word

Multiple words

from wordreference_scraper.wordreference_scraper import WordreferenceScraper

words = ['puzzle', 'noise', 'pencil']

wordreference_scraper_instance = WordreferenceScraper(words)

scraped_words = wordreference_scraper_instance.start()

print(scraped_words)

Selecting sections

Wordreference has multiple sections where shows the multiple meanings of word, such as 'Principal translations', 'Additional translations', 'Verbal Locutions', and 'Compound Forms'. These are the keys and values for the dictionary of sections to scrape

  • principal_translations - Boolean: Section for Principal Translations
  • additional_translations - Boolean: Section for Additional Translations
  • compound_forms - Boolean: Section for Compound Forms
  • locuciones_verbales - Boolean: Section for "Locuciones Verbales"
from wordreference_scraper.wordreference_scraper import WordreferenceScraper

words = ['Absolute', 'Note', 'Self']

sections = {
    'principal_translations':True,
    'additional_translations':True,
    'compound_forms':False,
    'locuciones_verbales':False
}

wordreference_scraper_instance = WordreferenceScraper(words,sections)

scraped_words = wordreference_scraper_instance.start()

print(scraped_words)

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

wordreference_scraper was created by Santiago Padron. It is licensed under the terms of the MIT license.

Credits

wordreference_scraper was created with cookiecutter and the py-pkgs-cookiecutter template.

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

wordreference_scraper-0.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wordreference_scraper-0.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file wordreference_scraper-0.1.1.tar.gz.

File metadata

  • Download URL: wordreference_scraper-0.1.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.12 Linux/5.15.0-46-generic

File hashes

Hashes for wordreference_scraper-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a3b25f06d9c4ed9396e137738609cb1cfc5e69d6b49830b99876b41493cf01cb
MD5 594b87b1a6c37c1bf765a27d6f586129
BLAKE2b-256 03a7e34ab18f001d6a8a7bbdb9fe9d4af4c04b7f133c556585e21749cbae8210

See more details on using hashes here.

File details

Details for the file wordreference_scraper-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for wordreference_scraper-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 93349611f6633db2989973da34658491f09959b733701696380cd154b8fdb874
MD5 52d6df3a1c7729c22bdeb6d02686a62e
BLAKE2b-256 0b2af99116c97d317c98aea457831e5d00c2b65b79a7b5bbbc61d185137226f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page