kevin

kevin

8 posts published

热搜爬虫

准备工作$ npm install puppeteer-core两种使用方式: 本地: puppeteer.launch()远程: puppeteer.connct()微博爬虫const fs = require('fs/promises'); const puppeteer = require('puppeteer-core'); (async () => { const browser = await puppeteer.launch({ headless: true, executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', args: ['--disable-notifications'] }); const [page] = await browser.pages(); const [textbox] = await Promise.all(

如何端口转发

iptablerinetdsocat假设有个第三方服务端(server)/客服端(client),它们只支持本地(127.0.0.1:10011)连接。通过socat就可以实现物理上的分离,如下所示: BEFORE ====== IP:x.x.x.x +--------+ | server | | | | | client | +--------+ AFTER ===== IP:x.x.x.x IP:y.y.y.y +--------+ +--------+ | server | +---|---+ | | | | | | | | | +----|---+ | client | +--------+ +--------+暴露本地端口: [Unit] Description=Socat Service Documentation=