Path: blob/master/node_modules/@bochilteam/scraper/lib/esm/news/antaranews.js
1126 views
import got from 'got';1import cheerio from 'cheerio';2export default async function antaranews() {3const html = await got('https://www.antaranews.com/').text();4const $ = cheerio.load(html);5const results = [];6$('div.terkini > article.simple-post').each((_, el) => {7const $el = $(el);8const title = $el.find('.latest-news > a').text();9const link = $el.find('.latest-news > a').attr('href');10const $image = $el.find('picture');11const image = $image.find('img').attr('src') ||12$image.find('img').attr('data-src') ||13$image.find('source').attr('srcset') ||14$image.find('source').attr('data-srcset');15const label = $el.find('.simple-share').text();16const date = $el.find('.simple-share > span').text();17if (title && image) {18results.push({19title,20link,21image,22label: label.replace(date, '').replace('/', '').trim(),23date: date.trim()24});25}26});27return results;28}29//# sourceMappingURL=antaranews.js.map3031