docs: make Chinese README the default
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
<!-- WEHUB_ZH_README -->
|
||||
> [!NOTE]
|
||||
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
|
||||
> [English](./README.en.md) · [原始项目](https://github.com/apify/crawlee) · [上游 README](https://github.com/apify/crawlee/blob/HEAD/README.md)
|
||||
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
|
||||
|
||||
<h1 align="center">
|
||||
<a href="https://crawlee.dev">
|
||||
<picture>
|
||||
@@ -6,7 +12,7 @@
|
||||
</picture>
|
||||
</a>
|
||||
<br>
|
||||
<small>A web scraping and browser automation library</small>
|
||||
<small>用于网页抓取与浏览器自动化的库</small>
|
||||
</h1>
|
||||
|
||||
<p align=center>
|
||||
@@ -20,25 +26,25 @@
|
||||
<a href="https://github.com/apify/crawlee/actions/workflows/test-ci.yml"><img src="https://github.com/apify/crawlee/actions/workflows/test-ci.yml/badge.svg?branch=master" alt="Build Status" style="max-width: 100%;"></a>
|
||||
</p>
|
||||
|
||||
Crawlee covers your crawling and scraping end-to-end and **helps you build reliable scrapers. Fast.**
|
||||
Crawlee 端到端覆盖你的爬取与抓取需求,**助你快速构建可靠的抓取器。**
|
||||
|
||||
Your crawlers will appear human-like and fly under the radar of modern bot protections even with the default configuration. Crawlee gives you the tools to crawl the web for links, scrape data, and store it to disk or cloud while staying configurable to suit your project's needs.
|
||||
即使使用默认配置,你的爬虫也能表现得像真人一样,并躲过现代机器人防护的检测。Crawlee 提供爬取网页链接、抓取数据并将其存储到磁盘或云端的工具,同时保持可配置,以满足你项目的需求。
|
||||
|
||||
Crawlee is available as the [`crawlee`](https://www.npmjs.com/package/crawlee) NPM package.
|
||||
Crawlee 以 [`crawlee`](https://www.npmjs.com/package/crawlee) NPM 包的形式提供。
|
||||
|
||||
> 👉 **View full documentation, guides and examples on the [Crawlee project website](https://crawlee.dev)** 👈
|
||||
> 👉 **在 [Crawlee 项目网站](https://crawlee.dev)** 查看完整文档、指南与示例** 👈
|
||||
|
||||
> Do you prefer 🐍 Python instead of JavaScript? [👉 Checkout Crawlee for Python 👈](https://github.com/apify/crawlee-python).
|
||||
> 你更喜欢 🐍 Python 而非 JavaScript?[👉 查看 Crawlee for Python 👈](https://github.com/apify/crawlee-python).
|
||||
|
||||
## Installation
|
||||
## 安装
|
||||
|
||||
We recommend visiting the [Introduction tutorial](https://crawlee.dev/js/docs/introduction) in Crawlee documentation for more information.
|
||||
我们建议查看 Crawlee 文档中的 [入门教程](https://crawlee.dev/js/docs/introduction) 以了解更多信息。
|
||||
|
||||
> Crawlee requires **Node.js 16 or higher**.
|
||||
> Crawlee 需要 **Node.js 16 或更高版本**。
|
||||
|
||||
### With Crawlee CLI
|
||||
### 使用 Crawlee CLI
|
||||
|
||||
The fastest way to try Crawlee out is to use the **Crawlee CLI** and choose the **Getting started example**. The CLI will install all the necessary dependencies and add boilerplate code for you to play with.
|
||||
试用 Crawlee 最快的方式是使用 **Crawlee CLI** 并选择 **Getting started example** 示例。CLI 会安装所有必要依赖,并添加样板代码供你上手体验。
|
||||
|
||||
```bash
|
||||
npx crawlee create my-crawler
|
||||
@@ -49,8 +55,8 @@ cd my-crawler
|
||||
npm start
|
||||
```
|
||||
|
||||
### Manual installation
|
||||
If you prefer adding Crawlee **into your own project**, try the example below. Because it uses `PlaywrightCrawler` we also need to install [Playwright](https://playwright.dev). It's not bundled with Crawlee to reduce install size.
|
||||
### 手动安装
|
||||
如果你更希望将 Crawlee **添加到你自己的项目**中,请尝试下面的示例。由于它使用了 `PlaywrightCrawler`,我们还需要安装 [Playwright](https://playwright.dev).。为减小安装体积,它并未与 Crawlee 捆绑在一起。
|
||||
|
||||
```bash
|
||||
npm install crawlee playwright
|
||||
@@ -82,17 +88,17 @@ const crawler = new PlaywrightCrawler({
|
||||
await crawler.run(['https://crawlee.dev']);
|
||||
```
|
||||
|
||||
By default, Crawlee stores data to `./storage` in the current working directory. You can override this directory via Crawlee configuration. For details, see [Configuration guide](https://crawlee.dev/js/docs/guides/configuration), [Request storage](https://crawlee.dev/js/docs/guides/request-storage) and [Result storage](https://crawlee.dev/js/docs/guides/result-storage).
|
||||
默认情况下,Crawlee 会将数据存储到当前工作目录下的 `./storage`。你可以通过 Crawlee 配置覆盖该目录。详情请参阅 [配置指南](https://crawlee.dev/js/docs/guides/configuration),、[请求存储](https://crawlee.dev/js/docs/guides/request-storage) 和 [结果存储](https://crawlee.dev/js/docs/guides/result-storage).
|
||||
|
||||
### Installing pre-release versions
|
||||
### 安装预发布版本
|
||||
|
||||
We provide automated beta builds for every merged code change in Crawlee. You can find them in the npm [list of releases](https://www.npmjs.com/package/crawlee?activeTab=versions). If you want to test new features or bug fixes before we release them, feel free to install a beta build like this:
|
||||
我们会为 Crawlee 中每一次合并的代码变更提供自动化的 beta 构建。你可以在 npm [发布列表](https://www.npmjs.com/package/crawlee?activeTab=versions). 中找到它们。如果你想在我们正式发布之前测试新功能或 bug 修复,可以像这样安装 beta 构建:
|
||||
|
||||
```bash
|
||||
npm install crawlee@next
|
||||
```
|
||||
|
||||
If you also use the [Apify SDK](https://github.com/apify/apify-sdk-js), you need to specify dependency overrides in your `package.json` file so that you don't end up with multiple versions of Crawlee installed:
|
||||
如果你还使用 [Apify SDK](https://github.com/apify/apify-sdk-js),,你需要在 `package.json` 文件中指定依赖覆盖(dependency overrides),以免安装多个版本的 Crawlee:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -106,48 +112,48 @@ If you also use the [Apify SDK](https://github.com/apify/apify-sdk-js), you need
|
||||
}
|
||||
```
|
||||
|
||||
## 🛠 Features
|
||||
## 🛠 特性
|
||||
|
||||
- Single interface for **HTTP and headless browser** crawling
|
||||
- Persistent **queue** for URLs to crawl (breadth & depth first)
|
||||
- Pluggable **storage** of both tabular data and files
|
||||
- Automatic **scaling** with available system resources
|
||||
- Integrated **proxy rotation** and session management
|
||||
- Lifecycles customizable with **hooks**
|
||||
- **CLI** to bootstrap your projects
|
||||
- Configurable **routing**, **error handling** and **retries**
|
||||
- **Dockerfiles** ready to deploy
|
||||
- Written in **TypeScript** with generics
|
||||
- 用于 **HTTP 与无头浏览器(headless browser)** 爬取的统一接口
|
||||
- 持久化 **队列(queue)**,用于管理待爬取 URL(支持广度优先与深度优先)
|
||||
- 可插拔的 **存储(storage)**,同时支持表格数据与文件
|
||||
- 根据可用系统资源自动 **扩缩(scaling)**
|
||||
- 内置 **代理轮换(proxy rotation)** 与会话管理
|
||||
- 可通过 **钩子(hooks)** 自定义生命周期
|
||||
- 用于初始化项目的 **CLI**
|
||||
- 可配置的 **路由(routing)**、**错误处理(error handling)** 与 **重试(retries)**
|
||||
- 可直接部署的 **Dockerfiles**
|
||||
- 使用 **TypeScript** 编写,支持泛型(generics)
|
||||
|
||||
### 👾 HTTP crawling
|
||||
### 👾 HTTP 爬取
|
||||
|
||||
- Zero config **HTTP2 support**, even for proxies
|
||||
- Automatic generation of **browser-like headers**
|
||||
- Replication of browser **TLS fingerprints**
|
||||
- Integrated fast **HTML parsers**. Cheerio and JSDOM
|
||||
- Yes, you can scrape **JSON APIs** as well
|
||||
- 零配置的 **HTTP2** 支持,代理同样适用
|
||||
- 自动生成**类浏览器请求头**
|
||||
- 复现浏览器的 **TLS 指纹**
|
||||
- 集成高速 **HTML 解析器**:Cheerio 与 JSDOM
|
||||
- 当然,你也可以抓取 **JSON API**
|
||||
|
||||
### 💻 Real browser crawling
|
||||
### 💻 真实浏览器爬取
|
||||
|
||||
- JavaScript **rendering** and **screenshots**
|
||||
- **Headless** and **headful** support
|
||||
- Zero-config generation of **human-like fingerprints**
|
||||
- Automatic **browser management**
|
||||
- Use **Playwright** and **Puppeteer** with the same interface
|
||||
- **Chrome**, **Firefox**, **Webkit** and many others
|
||||
- JavaScript **渲染(rendering)** 与 **截图(screenshots)**
|
||||
- 支持 **无头(headless)** 与 **有头(headful)** 模式
|
||||
- 零配置生成**类人指纹**
|
||||
- 自动 **浏览器管理**
|
||||
- 使用同一接口调用 **Playwright** 与 **Puppeteer**
|
||||
- 支持 **Chrome**、**Firefox**、**WebKit** 等
|
||||
|
||||
## Usage on the Apify platform
|
||||
## 在 Apify 平台上使用
|
||||
|
||||
Crawlee is open-source and runs anywhere, but since it's developed by [Apify](https://apify.com), it's easy to set up on the Apify platform and run in the cloud. Visit the [Apify SDK website](https://sdk.apify.com) to learn more about deploying Crawlee to the Apify platform.
|
||||
Crawlee 是开源的,可在任何地方运行,但由于它由 [Apify](https://apify.com), 开发,因此在 Apify 平台上搭建并在云端运行十分便捷。访问 [Apify SDK 网站](https://sdk.apify.com) 了解更多关于将 Crawlee 部署到 Apify 平台的信息。
|
||||
|
||||
## Support
|
||||
## 支持
|
||||
|
||||
If you find any bug or issue with Crawlee, please [submit an issue on GitHub](https://github.com/apify/crawlee/issues). For questions, you can ask on [Stack Overflow](https://stackoverflow.com/questions/tagged/apify), in GitHub Discussions or you can join our [Discord server](https://discord.com/invite/jyEM2PRvMU).
|
||||
如果你发现 Crawlee 的任何 bug 或问题,请 [在 GitHub 提交 issue](https://github.com/apify/crawlee/issues).。如有疑问,你可以在 [Stack Overflow](https://stackoverflow.com/questions/tagged/apify),、GitHub Discussions 提问,或加入我们的 [Discord 服务器](https://discord.com/invite/jyEM2PRvMU).
|
||||
|
||||
## Contributing
|
||||
## 贡献
|
||||
|
||||
Your code contributions are welcome, and you'll be praised to eternity! If you have any ideas for improvements, either submit an issue or create a pull request. For contribution guidelines and the code of conduct, see [CONTRIBUTING.md](https://github.com/apify/crawlee/blob/master/CONTRIBUTING.md).
|
||||
欢迎你的代码贡献,你将获得永世的赞誉!如果你有任何改进想法,请提交 issue 或创建 pull request。贡献指南与行为准则请参阅 [CONTRIBUTING.md](https://github.com/apify/crawlee/blob/master/CONTRIBUTING.md).
|
||||
|
||||
## License
|
||||
## 许可证
|
||||
|
||||
This project is licensed under the Apache License 2.0 - see the [LICENSE.md](https://github.com/apify/crawlee/blob/master/LICENSE.md) file for details.
|
||||
本项目采用 Apache License 2.0 许可 — 详情请参阅 [LICENSE.md](https://github.com/apify/crawlee/blob/master/LICENSE.md) 文件。
|
||||
|
||||
Reference in New Issue
Block a user