diff --git a/src/crawlee/project_template/cookiecutter.json b/src/crawlee/project_template/cookiecutter.json index 3b0b3700e7..3211a3f71d 100644 --- a/src/crawlee/project_template/cookiecutter.json +++ b/src/crawlee/project_template/cookiecutter.json @@ -3,7 +3,7 @@ "__package_name": "{{ cookiecutter.project_name|lower|replace('-', '_') }}", "crawler_type": ["beautifulsoup", "parsel", "playwright", "playwright-camoufox"], "__crawler_type": "{{ cookiecutter.crawler_type|lower|replace('-', '_') }}", - "http_client": ["httpx", "curl-impersonate"], + "http_client": ["httpx", "curl-impersonate", "impit"], "package_manager": ["poetry", "pip", "uv"], "enable_apify_integration": false, "install_project": true, diff --git a/src/crawlee/project_template/templates/main.py b/src/crawlee/project_template/templates/main.py index beed86f5ea..b2be397b79 100644 --- a/src/crawlee/project_template/templates/main.py +++ b/src/crawlee/project_template/templates/main.py @@ -7,6 +7,8 @@ from crawlee.http_clients import CurlImpersonateHttpClient # % elif cookiecutter.http_client == 'httpx' from crawlee.http_clients import HttpxHttpClient +# % elif cookiecutter.http_client == 'impit' +from crawlee.http_clients import ImpitHttpClient # % endif from .routes import router @@ -17,6 +19,8 @@ http_client=CurlImpersonateHttpClient(), # % elif cookiecutter.http_client == 'httpx' http_client=HttpxHttpClient(), +# % elif cookiecutter.http_client == 'impit' +http_client=ImpitHttpClient(), # % endif # % endblock # % endfilter diff --git a/src/crawlee/project_template/{{cookiecutter.project_name}}/pyproject.toml b/src/crawlee/project_template/{{cookiecutter.project_name}}/pyproject.toml index bd521dc19f..5c2146104d 100644 --- a/src/crawlee/project_template/{{cookiecutter.project_name}}/pyproject.toml +++ b/src/crawlee/project_template/{{cookiecutter.project_name}}/pyproject.toml @@ -5,6 +5,8 @@ # % endif # % if cookiecutter.http_client == 'curl-impersonate' # % do extras.append('curl-impersonate') +# % elif cookiecutter.http_client == 'impit' +# % do extras.append('impit') # % endif [project] diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index 0b6966c552..a2b0e13cd8 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -12,6 +12,7 @@ def pytest_configure(config: Config) -> None: for marker in [ 'httpx', 'curl_impersonate', + 'impit', 'playwright', 'playwright_camoufox', 'parsel', diff --git a/tests/e2e/project_template/test_static_crawlers_templates.py b/tests/e2e/project_template/test_static_crawlers_templates.py index ad5c46a8c1..07b3b11705 100644 --- a/tests/e2e/project_template/test_static_crawlers_templates.py +++ b/tests/e2e/project_template/test_static_crawlers_templates.py @@ -30,6 +30,7 @@ [ pytest.param('httpx', marks=pytest.mark.httpx), pytest.param('curl-impersonate', marks=pytest.mark.curl_impersonate), + pytest.param('impit', marks=pytest.mark.impit), ], ) @pytest.mark.parametrize(