Skip to content

Commit 508d7ce

Browse files
authored
feat: add impit option for Crawlee CLI (#1312)
### Description - Add `impit` option for Crawlee CLI ### Issues - Relates: #1079
1 parent 439d81e commit 508d7ce

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

src/crawlee/project_template/cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"__package_name": "{{ cookiecutter.project_name|lower|replace('-', '_') }}",
44
"crawler_type": ["beautifulsoup", "parsel", "playwright", "playwright-camoufox"],
55
"__crawler_type": "{{ cookiecutter.crawler_type|lower|replace('-', '_') }}",
6-
"http_client": ["httpx", "curl-impersonate"],
6+
"http_client": ["httpx", "curl-impersonate", "impit"],
77
"package_manager": ["poetry", "pip", "uv"],
88
"enable_apify_integration": false,
99
"install_project": true,

src/crawlee/project_template/templates/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from crawlee.http_clients import CurlImpersonateHttpClient
88
# % elif cookiecutter.http_client == 'httpx'
99
from crawlee.http_clients import HttpxHttpClient
10+
# % elif cookiecutter.http_client == 'impit'
11+
from crawlee.http_clients import ImpitHttpClient
1012
# % endif
1113

1214
from .routes import router
@@ -17,6 +19,8 @@
1719
http_client=CurlImpersonateHttpClient(),
1820
# % elif cookiecutter.http_client == 'httpx'
1921
http_client=HttpxHttpClient(),
22+
# % elif cookiecutter.http_client == 'impit'
23+
http_client=ImpitHttpClient(),
2024
# % endif
2125
# % endblock
2226
# % endfilter

src/crawlee/project_template/{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# % endif
66
# % if cookiecutter.http_client == 'curl-impersonate'
77
# % do extras.append('curl-impersonate')
8+
# % elif cookiecutter.http_client == 'impit'
9+
# % do extras.append('impit')
810
# % endif
911

1012
[project]

tests/e2e/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def pytest_configure(config: Config) -> None:
1212
for marker in [
1313
'httpx',
1414
'curl_impersonate',
15+
'impit',
1516
'playwright',
1617
'playwright_camoufox',
1718
'parsel',

tests/e2e/project_template/test_static_crawlers_templates.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
[
3131
pytest.param('httpx', marks=pytest.mark.httpx),
3232
pytest.param('curl-impersonate', marks=pytest.mark.curl_impersonate),
33+
pytest.param('impit', marks=pytest.mark.impit),
3334
],
3435
)
3536
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)