We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lyrics ins't returning nothing. Use this code to solve this:
import axios from "axios"; import { load } from "cheerio"; const scrapeLyrics = async (url) => { try { const { data } = await axios.get(url); const $ = load(data); let lyrics = ""; $("div[data-lyrics-container]").each((i, elem) => { const snippet = $(elem) .html() .replace(/<br\s*\/?>/g, "\n") .replace(/<[^>]+>/g, ""); lyrics += snippet.trim() + "\n\n"; }); if (!lyrics) { console.log("No letters found."); return null; } return lyrics.trim(); } catch (error) { console.error("Error while scraping:", error.message); return null; } }; const lyrics = await scrapeLyrics(result.url);
The text was updated successfully, but these errors were encountered:
Fix lyrics scraping (farshed#43) + refactor
7a4b526
No branches or pull requests
Lyrics ins't returning nothing.
Use this code to solve this:
The text was updated successfully, but these errors were encountered: