Finished fixing the web-scraper for Heroku

This commit is contained in:
ION606
2022-04-30 21:45:03 -04:00
parent 10adef1160
commit bd80c42bed
3 changed files with 24 additions and 4 deletions
+6 -4
View File
@@ -1,17 +1,19 @@
const hastebin = require("hastebin-gen");
module.exports ={
name: "scraper",
description: ".....",
execute(message, args) {
async execute(message, args) {
const axios = require('axios');
const cheerio = require('cheerio')
const url = args[0];
axios(url)
.then(response => {
.then(async response => {
const html = response.data;
const $ = cheerio.load(html);
//lyrics = $('.para_row').text();
message.channel.send(html);
const haste = await hastebin(html, { extension: "txt" });
message.channel.send(haste);
// console.log(lyrics);
})
.catch(console.error);