
浏览器指纹识别工具,用于匿名化你的爬虫。由 Apify 开发。
fingerprint-suite 是一套精心打造的工具集,用于浏览器指纹的生成与注入。
如今的网站越来越多地使用指纹识别来跟踪用户并识别其身份。
借助 fingerprint-suite,你可以生成浏览器指纹并将其注入到你的浏览器中,让你的爬虫在雷达下悄然飞行。
你愿意与我们一起开发指纹工具或类似项目吗?我们正在招聘!
fingerprint-suite 是一个用于浏览器指纹生成与注入的模块化工具包。它由以下 npm 包组成,你可以单独使用它们,也可以组合使用:
header-generator:生成可配置的、逼真的 HTTP 请求头fingerprint-generator:生成逼真的浏览器指纹,影响 HTTP 请求头和浏览器 JS APIfingerprint-injector:将浏览器指纹注入到你由 Playwright 或 Puppeteer 管理的浏览器实例中generative-bayesian-network:我们用于生成逼真浏览器指纹的贝叶斯生成网络的高效实现以下示例展示了如何使用指纹工具来伪装你由 Playwright 管理的 Chromium 实例。
npm install fingerprint-injector playwright
npx playwright install chromium
import { chromium } from 'playwright';
import { newInjectedContext } from 'fingerprint-injector';
(async () => {
const browser = await chromium.launch({ headless: false });
const context = await newInjectedContext(browser, {
// Constraints for the generated fingerprint (optional)
fingerprintOptions: {
devices: ['mobile'],
operatingSystems: ['ios'],
},
// Playwright's newContext() options (optional, random example for illustration)
newContextOptions: {
geolocation: {
latitude: 51.50853,
longitude: -0.12574,
},
},
});
const page = await context.newPage();
// ... your code using `page` here
await browser.close();
})();
以下是使用 Puppeteer 的同一示例:
npm install fingerprint-injector puppeteer
import puppeteer from 'puppeteer';
import { newInjectedPage } from 'fingerprint-injector';
(async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await newInjectedPage(browser, {
// constraints for the generated fingerprint
fingerprintOptions: {
devices: ['mobile'],
operatingSystems: ['ios'],
},
});
// ... your code using `page` here
await page.goto('https://example.com');
await browser.close();
})();
如果你发现任何指纹识别工具存在 bug 或问题,请在 GitHub 上提交 issue。 如有疑问,你可以在 Stack Overflow 上提问,或联系 [email protected]
欢迎你的代码贡献,你将获得永恒的赞誉! 如果你有任何改进的想法,请提交 issue 或创建 pull request。 有关贡献指南和行为准则, 请参阅 CONTRIBUTING.md。
本项目采用 Apache License 2.0 许可 - 详情请参阅 LICENSE.md 文件。