Skip to content

Commit f1e8bd5

Browse files
committed
allow ajax crawl middleware
1 parent 4a9665a commit f1e8bd5

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

src/apify/scrapy/utils.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ def apply_apify_settings(*, settings: Settings | None = None, proxy_config: dict
4040
# ensuring it is executed as the final step in the pipeline sequence
4141
settings['ITEM_PIPELINES']['apify.scrapy.pipelines.ActorDatasetPushPipeline'] = 1000
4242

43-
# Disable the default AjaxCrawlMiddleware since it can be problematic with Apify. It can return a new request
44-
# during process_response, but currently we have no way of detecting it and handling it properly.
45-
settings['DOWNLOADER_MIDDLEWARES']['scrapy.downloadermiddlewares.ajaxcrawl.AjaxCrawlMiddleware'] = None
46-
4743
# Replace the default HttpProxyMiddleware with ApifyHttpProxyMiddleware
4844
settings['DOWNLOADER_MIDDLEWARES']['scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware'] = None
4945
settings['DOWNLOADER_MIDDLEWARES']['apify.scrapy.middlewares.ApifyHttpProxyMiddleware'] = 750

tests/unit/scrapy/utils/test_apply_apify_settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def test_updates_downloader_middlewares() -> None:
4242

4343
assert new_settings.get('DOWNLOADER_MIDDLEWARES') == {
4444
'apify.scrapy.middlewares.ApifyHttpProxyMiddleware': 750,
45-
'scrapy.downloadermiddlewares.ajaxcrawl.AjaxCrawlMiddleware': None,
4645
'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware': 543,
4746
'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware': None,
4847
'scrapy.downloadermiddlewares.robotstxt.RobotsTxtMiddleware': 123,

0 commit comments

Comments
 (0)