Smart AI Web Scraper
Pricing
Pay per usage
Go to Apify Store
Smart AI Web Scraper
Unlock the power of Smart AI Web Scraper! Efficiently scrape dynamic content, simulate browser behavior, and extract targeted data.
Smart AI Web Scraper
Pricing
Pay per usage
Unlock the power of Smart AI Web Scraper! Efficiently scrape dynamic content, simulate browser behavior, and extract targeted data.
You can access the Smart AI Web Scraper programmatically from your own applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in API & Integrations in Apify Console.
1import { ApifyClient } from 'apify-client';2
3// Initialize the ApifyClient with your Apify API token4// Replace the '<YOUR_API_TOKEN>' with your token5const client = new ApifyClient({6 token: '<YOUR_API_TOKEN>',7});8
9// Prepare Actor input10const input = {11 "startUrl": "https://www.scrapethissite.com/pages/",12 "actions": [13 {14 "action": "Click heading: Hockey Teams: Forms, Searching and Pagination",15 "waitAfterAction": 0.5,16 "waitBeforeAction": 0.517 }18 ],19 "fields": [20 {21 "dataType": "text",22 "fieldName": "Team Name"23 },24 {25 "dataType": "number",26 "fieldName": "Year"27 },28 {29 "dataType": "number",30 "fieldName": "Wins"31 },32 {33 "dataType": "number",34 "fieldName": "Losses"35 },36 {37 "dataType": "number",38 "fieldName": "Win %"39 },40 {41 "dataType": "number",42 "fieldName": "Goals Against"43 },44 {45 "dataType": "number",46 "fieldName": "Goals For"47 }48 ],49 "proxyConfiguration": {50 "useApifyProxy": false51 }52};53
54// Run the Actor and wait for it to finish55const run = await client.actor("cockroachapi/smart-ai-web-scraper").call(input);56
57// Fetch and print Actor results from the run's dataset (if any)58console.log('Results from dataset');59console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);60const { items } = await client.dataset(run.defaultDatasetId).listItems();61items.forEach((item) => {62 console.dir(item);63});64
65// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docsThe Apify API client for JavaScript is the official library that allows you to use Smart AI Web Scraper API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.
Install the apify-client
$npm install apify-clientOther API clients include: