Created
February 12, 2021 09:27
-
-
Save Akifcan/9890fe36152fa6fa515d6063f94d335b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function searchSong() { | |
const response = await axios.get('https://www.lyrics.com/lyric/35855205/Alan+Walker/Lost+Control') //sayfa kaynak kodunu alıyoruz | |
const $ = cheerio.load(response.data) // ve kaynak kodunu cheerioya yüklüyoruz | |
const lyrcis = $('.lyric-body').text(); | |
//az önce tarayıcı konsolunda cevabını aldığımız .lyric-body sınıfını uygulamamızdan aratıyoruz | |
const songName = $('#lyric-title-text').text() | |
const artist = $('.lyric-artist a:not(:last-child)').text() | |
return { | |
lyrcis, songName, artist | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment