Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

javascript es6 5. Using Async/Awiait syntax that interact with the previous Promise functions that attempts to scrap websites for data. Write a function called asyncAwaitWebsiteScraps().

javascript es6

5. Using Async/Awiait syntax that interact with the previous Promise functions that attempts to scrap websites for data.

Write a function called asyncAwaitWebsiteScraps().

  • This function accepts one argument which is a website object.
  • This function uses the async/await syntax to interact with the previously written Promise functions openWebsitePromises() and scrapDataPromises()
  • This function should print to the console thesuccessanderrorsand handle both cases properly for async/await syntax.
    • Success should print: scrapped from . (see expected outputs below)
    • Error should print: is down. (see expected outputs below)
  • ONLY use the functions from Question #4 with asyncAwaitWebsiteScraps() . Do not write any additional supporting functions.
  • DoNOTuse a setTimeout() in this function.

EXAMPLES:

Example Argument passed into the asyncAwaitWebsiteScraps function:

const google = {

site: 'google.com',

dataSize: 1,

responseTime: 0

};

OUTPUT:

scrapped 1 mb from google.com.

Example Argument passed into the asyncAwaitWebsiteScraps function:

const redditt = {

site: 'redditt.com',

dataSize: 200,

responseTime: null

};

OUTPUT:

redditt.com is down.

Example Argument passed into the asyncAwaitWebsiteScraps function:

const github = {

site: 'github.com',

dataSize: 500,

responseTime: 50

};

OUTPUT:

scrapped 500 mb from github.com

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

Mobile Usability

Authors: Jakob Nielsen, Raluca Budiu

1st Edition

0133122131, 9780133122138

More Books

Students also viewed these Programming questions

Question

What is job rotation ?

Answered: 1 week ago

Question

75. Let a1 Answered: 1 week ago

Answered: 1 week ago