程式狂想筆記

一個攻城師奮鬥史

0%

Nodejs 使用 cheerio 做簡單爬蟲

官方文件:Chinese README · cheeriojs/cheerio Wiki

安裝 cheerio

1
npm install cherrio -D

npm -i 与npm install -s与-d的区别 - 世界,太精彩 - 博客园

Cheerio.js.org vs JsDOM – Hardwork beats talent, when talent doesnt, work hard

https://qaz33326.pixnet.net/blog/post/46540628-jquery---$.each%E5%A6%82%E4%BD%95%E5%81%9A%E5%88%B0continue,-break

const __dirname = path.resolve();

Module in Node.js. 越是使用起來覺得理所當然的東西,有時候停下來想想,越是覺得陌生。 | by TD | TD’s note | Medium

1
2
3
4
import { fileURLToPath } from 'url'
import { dirname } from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

Node.js使用ES6 Module | Eddy 思考與學習

使用 tag 查詢不難,跟jQuery 差不多這邊。