Skip to content

Instantly share code, notes, and snippets.

@kaveenr
Last active July 21, 2021 16:50
Show Gist options
  • Save kaveenr/6d8295ff6c887789349cec65ddf5919c to your computer and use it in GitHub Desktop.
Save kaveenr/6d8295ff6c887789349cec65ddf5919c to your computer and use it in GitHub Desktop.
Madura Dict Scraper

Disclaimer

This code is for education purposes only!

The code shown in this gist is copyleft and provided "AS IS".

For serious or Commerical uses of this script with Madura Online, I'd suggest you contact Madura K.

Usage Instructions

npm install
npm run start
var Xray = require('x-ray')
var x = Xray()
x('https://maduraonline.com/?find=', '.tb > tr', [
{
entry: 'a',
link: 'a@href',
results: x('a@href', {
nestedResult: x('.tb > tr', [{
type: '.ty',
desc: '.td'
}])
})
}
])
.paginate('body > div > div:nth-child(3) > p:nth-child(3) > a:last-child@href')
.write('results.json')
{
"name": "madura2json",
"version": "1.0.0",
"main": "index.js",
"license": "copyleft-next-0.3.1",
"dependencies": {
"x-ray": "^2.3.4"
},
"scripts": {
"start": "node index.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment