{"size": 582, "ext": "js", "max_stars_repo_path": "src/sites/target.js", "max_stars_repo_name": "DylanAlloy/scraper", "max_stars_repo_stars_event_min_datetime": "2017-10-15T03:41:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-19T10:34:53.000Z", "max_issues_repo_path": "src/sites/target.js", "max_issues_repo_name": "soltrinox/scraper", "max_issues_repo_issues_event_min_datetime": "2018-07-17T21:50:15.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-02T04:28:58.000Z", "max_forks_repo_path": "src/sites/target.js", "max_forks_repo_name": "soltrinox/scraper", "max_forks_repo_forks_event_min_datetime": "2017-12-09T00:27:24.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-10T06:19:22.000Z"}
{"max_stars_count": 48, "max_issues_count": 21, "max_forks_count": 17, "avg_line_length": 25.3043478261, "max_line_length": 74, "alphanum_fraction": 0.6494845361}
import { stripAndTrim, lookupFailure, getText, getSrc } from "../helpers";

export const name = "target";
export const hosts = ["www.target.com"];
export const scrape = async page => {
  const title = await getText('[data-test="product-title"]', page);
  const price = await getText('[data-test="product-price"]', page);
  const image = await getSrc('[data-test="carousel-image"] img', page);
  const description = await getText(
    "#specAndDescript:last-child > div > div",
    page
  );

  const data = {
    title,
    price,
    image,
    description
  };

  return data;
};
