Skip to content

Commit a17b3b1

Browse files
authored
chore: Forgotten review comments (#709)
part of #167 that I forgot to push - sorry @vdusek
1 parent c80812c commit a17b3b1

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

src/crawlee/beautifulsoup_crawler/_beautifulsoup_crawler.py

+2
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ async def _handle_blocked_request(
147147
if self._retry_on_blocked:
148148
status_code = context.http_response.status_code
149149

150+
# TODO: refactor to avoid private member access
151+
# https://github.com/apify/crawlee-python/issues/708
150152
if (
151153
context.session
152154
and status_code not in self._http_client._ignore_http_error_status_codes # noqa: SLF001

src/crawlee/http_crawler/_http_crawler.py

+2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ async def _handle_blocked_request(self, context: HttpCrawlingContext) -> AsyncGe
127127
if self._retry_on_blocked:
128128
status_code = context.http_response.status_code
129129

130+
# TODO: refactor to avoid private member access
131+
# https://github.com/apify/crawlee-python/issues/708
130132
if (
131133
context.session
132134
and status_code not in self._http_client._ignore_http_error_status_codes # noqa: SLF001

src/crawlee/parsel_crawler/_parsel_crawler.py

+2
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ async def _handle_blocked_request(
140140
if self._retry_on_blocked:
141141
status_code = context.http_response.status_code
142142

143+
# TODO: refactor to avoid private member access
144+
# https://github.com/apify/crawlee-python/issues/708
143145
if (
144146
context.session
145147
and status_code not in self._http_client._ignore_http_error_status_codes # noqa: SLF001

tests/unit/browsers/test_playwright_browser_controller.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def test_initial_state(browser: Browser) -> None:
4646

4747
async def test_open_and_close_page(controller: PlaywrightBrowserController, httpbin: URL) -> None:
4848
page = await controller.new_page()
49-
await page.goto(f'{httpbin}')
49+
await page.goto(str(httpbin))
5050

5151
assert page in controller.pages
5252
assert controller.pages_count == 1

tests/unit/playwright_crawler/test_playwright_crawler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,6 @@ async def test_pre_navigation_hook(httpbin: URL) -> None:
165165
async def request_handler(_context: PlaywrightCrawlingContext) -> None:
166166
pass
167167

168-
await crawler.run(['https://example.com', f'{httpbin}'])
168+
await crawler.run(['https://example.com', str(httpbin)])
169169

170170
assert mock_hook.call_count == 2

0 commit comments

Comments
 (0)