Skip to content
Snippets Groups Projects
Commit e9cbd328 authored by carlos93's avatar carlos93
Browse files

Added parsingScript

-Added parsing Script
parent 79efb8a2
Branches CarloS
No related tags found
No related merge requests found
import fetch from 'node-fetch'
import * as parser from 'node-html-parser'
const url =
'https://www.buchsys.de/fu-berlin/angebote/aktueller_zeitraum/index.html'
export function parseFromBuchsys() {
return fetch(url)
.then(function (data) {
return data
.text()
.then((html) => {
var array = []
var data = parser
.parse(html)
.querySelector('dl')
.querySelectorAll('a')
data.map((child) => {
array.push([child.text, child.getAttribute('href')])
})
return array
})
.catch(() => [])
})
.catch(() => [])
}
//parseFromBuchsys().then((e) => console.log(e))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment