Newsweek Scraper

3 days trial then $20.00/month - No credit card required now

Newsweek Scraper

Newsweek Scraper

epctex/newsweek-scraper

3 days trial then $20.00/month - No credit card required now

Scrape the latest articles right away from Newsweek. Retrieve your news directly with the information of title, body, published time, updated time, keywords, images, videos, and many more! Get your data with JSON, XML, Excel, CSV, or many other options. Extremely fast, optimized, and with no limits!

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn mode

import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with API token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        "https://www.newsweek.com/ron-desantis-abortion-six-week-bill-2024-1794367",
        "https://www.newsweek.com/topic/climate-change",
        "https://www.newsweek.com/authors/jon-jackson",
        "https://www.newsweek.com/search/site/?q=biden",
        "https://www.newsweek.com/education"
    ],
    "search": "donald trump",
    "maxItems": 20,
    "endPage": 1,
    "extendOutputFunction": ($) => { return {} },
    "customMapFunction": (object) => { return {...object} },
    "proxy": {
        "useApifyProxy": true
    }
};

(async () => {
    // Run the Actor and wait for it to finish
    const run = await client.actor("epctex/newsweek-scraper").call(input);

    // Fetch and print Actor results from the run's dataset (if any)
    console.log('Results from dataset');
    const { items } = await client.dataset(run.defaultDatasetId).listItems();
    items.forEach((item) => {
        console.dir(item);
    });
})();
Developer
Maintained by Community
Actor stats
  • 6 users
  • 468 runs
  • Modified about 7 hours ago

You might also like these Actors