You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Crawlee currently provides two main HTTP clients: <ApiLinkto="core/class/GotScrapingHttpClient">`GotScrapingHttpClient`</ApiLink>, which uses the `got-scraping` library, and <ApiLinkto="impit-client/class/ImpitHttpClient">`ImpitHttpClient`</ApiLink>, which uses the `impit` library. You can switch between them by setting the `BasehttpClient` parameter when initializing a crawler class. The default HTTP client is <ApiLinkto="core/class/GotScrapingHttpClient">`GotScrapingHttpClient`</ApiLink>. For more details on anti-blocking features, see our [avoid getting blocked guide](./avoid-blocking).
52
+
Crawlee currently provides two main HTTP clients: <ApiLinkto="got-scraping-client/class/GotScrapingHttpClient">`GotScrapingHttpClient`</ApiLink>, which uses the `got-scraping` library, and <ApiLinkto="impit-client/class/ImpitHttpClient">`ImpitHttpClient`</ApiLink>, which uses the `impit` library. You can switch between them by setting the `BasehttpClient` parameter when initializing a crawler class. The default HTTP client is <ApiLinkto="got-scraping-client/class/GotScrapingHttpClient">`GotScrapingHttpClient`</ApiLink>. For more details on anti-blocking features, see our [avoid getting blocked guide](./avoid-blocking).
53
53
54
54
Below are examples of how to configure the HTTP client for the <ApiLinkto="cheerio-crawler/class/CheerioCrawler">`CheerioCrawler`</ApiLink>:
55
55
@@ -68,7 +68,7 @@ Below are examples of how to configure the HTTP client for the <ApiLink to="chee
68
68
69
69
## Installation requirements
70
70
71
-
Since <ApiLinkto="core/class/GotScrapingHttpClient">`GotScrapingHttpClient`</ApiLink> is the default HTTP client, it's included with the base Crawlee installation and requires no additional packages.
71
+
Since <ApiLinkto="got-scraping-client/class/GotScrapingHttpClient">`GotScrapingHttpClient`</ApiLink> is the default HTTP client, it's included with the base Crawlee installation and requires no additional packages.
72
72
73
73
For <ApiLinkto="impit-client/class/ImpitHttpClient">`ImpitHttpClient`</ApiLink>, you need to install a separate `@crawlee/impit-client` package:
74
74
@@ -78,7 +78,7 @@ npm i @crawlee/impit-client
78
78
79
79
## Creating custom HTTP clients
80
80
81
-
Crawlee provides an interface, <ApiLinkto="core/interface/BaseHttpClient">`BaseHttpClient`</ApiLink>, which defines the interface that all HTTP clients must implement. This allows you to create custom HTTP clients tailored to your specific requirements.
81
+
Crawlee provides an interface, <ApiLinkto="types/interface/BaseHttpClient">`BaseHttpClient`</ApiLink>, which defines the interface that all HTTP clients must implement. This allows you to create custom HTTP clients tailored to your specific requirements.
82
82
83
83
HTTP clients are responsible for several key operations:
84
84
@@ -88,10 +88,10 @@ HTTP clients are responsible for several key operations:
88
88
- managing proxy configurations,
89
89
- connection pooling with timeout management.
90
90
91
-
To create a custom HTTP client, you need to implement the <ApiLinkto="core/interface/BaseHttpClient">`BaseHttpClient`</ApiLink> interface. Your implementation must be async-compatible and include proper cleanup and resource management to work seamlessly with Crawlee's concurrent processing model.
91
+
To create a custom HTTP client, you need to implement the <ApiLinkto="types/interface/BaseHttpClient">`BaseHttpClient`</ApiLink> interface. Your implementation must be async-compatible and include proper cleanup and resource management to work seamlessly with Crawlee's concurrent processing model.
92
92
93
93
## Conclusion
94
94
95
-
This guide introduced you to the HTTP clients available in Crawlee and demonstrated how to switch between them, including their installation requirements and usage examples. You also learned about the responsibilities of HTTP clients and how to implement your own custom HTTP client by inheriting from the <ApiLinkto="core/interface/BaseHttpClient">`BaseHttpClient`</ApiLink> base class.
95
+
This guide introduced you to the HTTP clients available in Crawlee and demonstrated how to switch between them, including their installation requirements and usage examples. You also learned about the responsibilities of HTTP clients and how to implement your own custom HTTP client by inheriting from the <ApiLinkto="types/interface/BaseHttpClient">`BaseHttpClient`</ApiLink> base class.
96
96
97
97
If you have questions or need assistance, feel free to reach out on our [GitHub](https://github.com/apify/crawlee) or join our [Discord community](https://discord.com/invite/jyEM2PRvMU). Happy scraping!
0 commit comments