Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I created a node file that will scrape the provided url: https://www.billboard.com/charts/rap-song and and send an email of all artists & songs that are sung

I created a node file that will scrape the provided url: https://www.billboard.com/charts/rap-song and and send an email of all artists & songs that are sung by the specified artists given via the command line. however, instead of sending the specific artist and songs that are sung via the command line, it will print out on command line. it send differnt thing to e-mail.

this is my code

part 1

image text in transcribed

part 2 code

image text in transcribed

this wat send to email

image text in transcribed

this is what printout on command , which supposed to send to email

node ag.js Migos

image text in transcribed

I want to send to email

Artist:

Migos

Song:Stir Fry

to email when I tyoed node ag.js Migos.

Atrist and song

xpress- require express var request = require(' request'); var cheerio require('cheerio'); var nodemailer require('nodemailer); var fs require('fs') var app express var artist - process.argv [2]; String(artist); var transporter nodemailer.createTransport( service: 'gmail', auth: user: 'me@gmail.com' pass: 'jesis' F) app. get (?scrape' , function ( req, res) { var $,scraped_data, url; url- 'https://www.billboard.com/charts/rap-song'; request(url, function(error, response, htm) if(!error&& response.statusCode200) //scraped-data= $('a.chart-row artist').text(); scraped_data('a.chart-row_artist').each(function) if($(this).text ( ) . trin() = artist) { console. log ("Artist:"+$(this) .text () +" Song :"+5(this).siblings('.chart-row-song') . text ()); //console.log(artist+""+$(this).text).trim)) var mailOptions from: me@gmail.com', to 'lu@gmail.com', subject: 'Let it can be any subject' text: 'List of artists scraped_data t; transporter.sendMail(mailOptions, function(error,info)t xpress- require express var request = require(' request'); var cheerio require('cheerio'); var nodemailer require('nodemailer); var fs require('fs') var app express var artist - process.argv [2]; String(artist); var transporter nodemailer.createTransport( service: 'gmail', auth: user: 'me@gmail.com' pass: 'jesis' F) app. get (?scrape' , function ( req, res) { var $,scraped_data, url; url- 'https://www.billboard.com/charts/rap-song'; request(url, function(error, response, htm) if(!error&& response.statusCode200) //scraped-data= $('a.chart-row artist').text(); scraped_data('a.chart-row_artist').each(function) if($(this).text ( ) . trin() = artist) { console. log ("Artist:"+$(this) .text () +" Song :"+5(this).siblings('.chart-row-song') . text ()); //console.log(artist+""+$(this).text).trim)) var mailOptions from: me@gmail.com', to 'lu@gmail.com', subject: 'Let it can be any subject' text: 'List of artists scraped_data t; transporter.sendMail(mailOptions, function(error,info)t

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

b. What are its goals and objectives?

Answered: 1 week ago