
網頁資料解析器
Pricing
$35.00 / 1,000 results
Go to Apify Store

網頁資料解析器
繁體中文介面的簡單網頁爬蟲工具。擷取網站的標題、段落、連結、圖片、表格等資料。支援自訂 CSS 選擇器和批量收集。 如有大量網頁爬蟲需求,推薦使用 Apify 的 Web Content Crawler
0.0 (0)
Pricing
$35.00 / 1,000 results
2
3
3
Last modified
3 days ago
You can access the 網頁資料解析器 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 Integrations settings 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 "startUrls": [12 {13 "url": "https://apify.com/futurizerush"14 },15 {16 "url": "https://rush.zeabur.app/"17 },18 {19 "url": "https://www.threads.com/@futurizerush"20 }21 ],22 "maxRequestsPerCrawl": 10,23 "maxConcurrency": 3,24 "smartMode": true,25 "cacheEnabled": true,26 "extractionRules": {27 "文章標題": "h1.post-title, h1.article-title, h1.entry-title",28 "文章內容": "article, main, .post-content, .article-content",29 "作者": ".author-name, .by-author, .post-author",30 "發布日期": "time, .post-date, .publish-date",31 "分類": ".category, .post-category",32 "標籤": ".tags a, .post-tags a"33 },34 "customData": {35 "source": "Apify Actor",36 "scraped_by": "@futurizerush",37 "language": "zh-TW"38 },39 "waitForSelector": "",40 "scrollToBottom": false,41 "pageLoadTimeoutSecs": 25,42 "blockResources": []43};44
45// Run the Actor and wait for it to finish46const run = await client.actor("futurizerush/web-scraper-zh-tw").call(input);47
48// Fetch and print Actor results from the run's dataset (if any)49console.log('Results from dataset');50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);51const { items } = await client.dataset(run.defaultDatasetId).listItems();52items.forEach((item) => {53 console.dir(item);54});55
56// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
網頁資料解析器 API in JavaScript
The Apify API client for JavaScript is the official library that allows you to use 網頁資料解析器 API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.
Install the apify-client
$npm install apify-client
Other API clients include: