-
Notifications
You must be signed in to change notification settings - Fork 7
Scraper
Marcelo Perrella edited this page Oct 7, 2019
·
5 revisions
BDOScraper provides a group of functions, each mapping to a different entity type. It also provides some Enums for consistency (see below).
const { Item, Recipe, Enums } = require('bdo-scraper')
async () => {
// Scrape data for item 9233 in english
const itemData = await Item(9233, Enums.LANGS.en)
// Scrape data for recipe 122 in portuguese
const recipeData = await Recipe(122, Enums.LANGS.pt)
}A general scraper can be used in addition to Enums.TYPE if preferred.
const { Scraper, Enums } = require('bdo-scraper')
async () => {
const data = await Scraper(9213, Enums.LANGS.en, Enums.TYPE.item)
}Scraper(id, lang, type, full_data_flag)
Item(id, lang, full_data_flag)| Parameter Name | Type | Default | Possible Values |
|---|---|---|---|
id |
Number |
undefined |
The entity id (used to parse the URI). |
lang |
Enums.LANGS |
en |
The language in which to retrieve the information. |
type |
Enums.TYPES |
undefined |
The type of entity to scrape. It's only required when using Scraper. |
full_data_flag |
Bool |
true |
If true, make extra requests and get all data. |
| Scraper Name | Used for |
|---|---|
Item |
Equipments, consumables, materials, etc |
Recipe |
Any type of recipe (cooking, alchemy, processing) |
MaterialGroup |
Material groups (cereals, fruits, etc) |
const { Enums } = require('bdo-scraper')| Enum | Values | Description |
|---|---|---|
LANGS |
en || pt |
Used for defining the request language. |
TYPES |
item || recipe || materialGroup |
Used for defining the scraper type when using Scraper. |