bhfutils 0.2.99__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bhfutils-0.2.99 → bhfutils-0.3.0}/PKG-INFO +1 -1
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/custom_cookies.py +2 -2
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/items.py +2 -4
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/log_retry_middleware.py +3 -3
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/meta_passthrough_middleware.py +23 -11
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/redis_stats_middleware.py +5 -2
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils.egg-info/PKG-INFO +1 -1
- {bhfutils-0.2.99 → bhfutils-0.3.0}/setup.py +1 -1
- {bhfutils-0.2.99 → bhfutils-0.3.0}/MANIFEST.in +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/README.rst +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/bhf_signals.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/config/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/config/file_pusher.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/distributed_scheduler.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/expire.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/pipelines.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/do_async/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/do_async/_mouse_helper.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/do_async/_spoof.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/do_sync/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/do_sync/_mouse_helper.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/do_sync/_spoof.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/js/mouseHelper.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/shared/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/shared/math.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/shared/spoof.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/handler.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/headers.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/chrome.app.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/chrome.csi.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/chrome.loadtimes.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/chrome.runtime.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/hairline.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/iframe.contentWindow.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/magic-arrays.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/media.codecs.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/navigator.deviceMemory.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/navigator.hardwareConcurrency.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/navigator.languages.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/navigator.permissions.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/navigator.platform.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/navigator.plugins.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/navigator.userAgent.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/navigator.vendor.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/navigator.webdriver.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/screen.touch.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/user-agent-override.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/utils.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/webgl.vendor.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/window.dimensions.js +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/page.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/stealth.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/policy.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/proxy_rotate.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/redis_domain_max_page_filter.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/redis_dupefilter.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/redis_global_page_per_domain_filter.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/redis_retry_middleware.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/settings_template.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/spiders/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/spiders/redis_spider.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/online.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/test_distributed_scheduler.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/test_link_spider.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/test_log_retry_middleware.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/test_meta_passthrough_middleware.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/test_pipelines.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/test_redis_dupefilter.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/test_redis_page_limit_filters.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/test_redis_retry_middleware.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/test_redis_stats_middleware.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/test_wandering_spider.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/examples/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/examples/example_ah.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/examples/example_lf.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/examples/example_mt.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/examples/example_rq.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/examples/example_rtq.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/examples/example_sc.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/examples/example_sw.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/examples/example_zw.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/scutils/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/scutils/argparse_helper.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/scutils/log_factory.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/scutils/method_timer.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/scutils/redis_queue.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/scutils/redis_throttled_queue.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/scutils/settings_wrapper.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/scutils/stats_collector.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/scutils/zookeeper_watcher.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/__init__.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/default_settings.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/online.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/override_defaults.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/test_argparse_helper.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/test_log_factory.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/test_method_timer.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/test_redis_queue.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/test_redis_throttled_queue.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/test_settings_wrapper.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/test_stats_collector.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/test_zookeeper_watcher.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/tests/throttled_queue.py +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils.egg-info/SOURCES.txt +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils.egg-info/dependency_links.txt +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils.egg-info/requires.txt +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils.egg-info/top_level.txt +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils.egg-info/zip-safe +0 -0
- {bhfutils-0.2.99 → bhfutils-0.3.0}/setup.cfg +0 -0
|
@@ -7,7 +7,7 @@ class CustomCookiesMiddleware(CookiesMiddleware):
|
|
|
7
7
|
persist between calls
|
|
8
8
|
'''
|
|
9
9
|
|
|
10
|
-
def process_request(self, request
|
|
10
|
+
def process_request(self, request):
|
|
11
11
|
if 'dont_merge_cookies' in request.meta:
|
|
12
12
|
return
|
|
13
13
|
|
|
@@ -22,4 +22,4 @@ class CustomCookiesMiddleware(CookiesMiddleware):
|
|
|
22
22
|
request.headers.pop('Cookie', None)
|
|
23
23
|
jar.add_cookie_header(request)
|
|
24
24
|
|
|
25
|
-
self._debug_cookie(request
|
|
25
|
+
self._debug_cookie(request)
|
|
@@ -44,16 +44,14 @@ class AggregatorPriceResponseItem(RawResponseItem):
|
|
|
44
44
|
price = Field()
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
class ProductDetailsResponseItem(
|
|
48
|
-
playgroundId = Field()
|
|
49
|
-
productUrl = Field()
|
|
50
|
-
groupId = Field()
|
|
47
|
+
class ProductDetailsResponseItem(ProductResponseItem):
|
|
51
48
|
imageUrls = Field()
|
|
52
49
|
type = Field()
|
|
53
50
|
name = Field()
|
|
54
51
|
brandName = Field()
|
|
55
52
|
sellerName = Field()
|
|
56
53
|
description = Field()
|
|
54
|
+
vendorCode = Field()
|
|
57
55
|
details = Field()
|
|
58
56
|
comments = Field()
|
|
59
57
|
|
|
@@ -85,12 +85,12 @@ class LogRetryMiddleware(object):
|
|
|
85
85
|
crawler.settings.set('SPIDER_NAME', crawler.spider.name)
|
|
86
86
|
return cls.from_settings(crawler.settings)
|
|
87
87
|
|
|
88
|
-
def process_exception(self, request, exception
|
|
88
|
+
def process_exception(self, request, exception):
|
|
89
89
|
if isinstance(exception, self.EXCEPTIONS_TO_RETRY):
|
|
90
|
-
self._log_retry(request, exception
|
|
90
|
+
self._log_retry(request, exception)
|
|
91
91
|
self._increment_504_stat(request)
|
|
92
92
|
|
|
93
|
-
def _log_retry(self, request, exception
|
|
93
|
+
def _log_retry(self, request, exception):
|
|
94
94
|
extras = {}
|
|
95
95
|
extras['logger'] = self.logger.name
|
|
96
96
|
extras['error_request'] = request
|
|
@@ -35,19 +35,31 @@ class MetaPassthroughMiddleware(object):
|
|
|
35
35
|
def from_crawler(cls, crawler):
|
|
36
36
|
return cls(crawler.settings)
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
@staticmethod
|
|
39
|
+
def _passthrough(response, x):
|
|
40
|
+
# only operate on requests: pass along all known meta fields, but only
|
|
41
|
+
# if they were not already set in the spider's new request
|
|
42
|
+
if isinstance(x, Request):
|
|
43
|
+
for key in list(response.meta.keys()):
|
|
44
|
+
if key not in x.meta and key != 'playwright_page_methods':
|
|
45
|
+
x.meta[key] = response.meta[key]
|
|
46
|
+
return x
|
|
47
|
+
|
|
48
|
+
def process_spider_output(self, response, result):
|
|
39
49
|
'''
|
|
40
50
|
Ensures the meta data from the response is passed
|
|
41
|
-
through in any Request's generated from the spider
|
|
51
|
+
through in any Request's generated from the spider (sync path).
|
|
42
52
|
'''
|
|
43
53
|
self.logger.debug("processing meta passthrough middleware")
|
|
44
54
|
for x in result:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
yield self._passthrough(response, x)
|
|
56
|
+
|
|
57
|
+
async def process_spider_output_async(self, response, result):
|
|
58
|
+
'''
|
|
59
|
+
Async-generator variant required by Scrapy >= 2.13 when the spider
|
|
60
|
+
output is an async iterable (AsyncCrawlerProcess). Defining both makes
|
|
61
|
+
this a "universal" spider middleware compatible with old + new Scrapy.
|
|
62
|
+
'''
|
|
63
|
+
self.logger.debug("processing meta passthrough middleware (async)")
|
|
64
|
+
async for x in result:
|
|
65
|
+
yield self._passthrough(response, x)
|
|
@@ -58,7 +58,9 @@ class RedisStatsMiddleware(object):
|
|
|
58
58
|
|
|
59
59
|
@classmethod
|
|
60
60
|
def from_crawler(cls, crawler):
|
|
61
|
-
|
|
61
|
+
obj = cls(crawler.settings)
|
|
62
|
+
obj.crawler = crawler
|
|
63
|
+
return obj
|
|
62
64
|
|
|
63
65
|
def _get_hostname(self):
|
|
64
66
|
'''
|
|
@@ -108,12 +110,13 @@ class RedisStatsMiddleware(object):
|
|
|
108
110
|
.format(h=hostname, n=spider_name, s=status_code))
|
|
109
111
|
self.stats_dict[spider_name]['status_codes'][status_code]['lifetime'] = total
|
|
110
112
|
|
|
111
|
-
def process_spider_input(self, response
|
|
113
|
+
def process_spider_input(self, response):
|
|
112
114
|
'''
|
|
113
115
|
Ensures the meta data from the response is passed
|
|
114
116
|
through in any Request's generated from the spider
|
|
115
117
|
'''
|
|
116
118
|
self.logger.debug("processing redis stats middleware")
|
|
119
|
+
spider = self.crawler.spider
|
|
117
120
|
if self.settings['STATS_STATUS_CODES']:
|
|
118
121
|
if spider.name not in self.stats_dict:
|
|
119
122
|
self._setup_stats_status_codes(spider.name)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/do_async/_mouse_helper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/cursor/do_sync/_mouse_helper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/playwright/js/navigator.hardwareConcurrency.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bhfutils-0.2.99 → bhfutils-0.3.0}/bhfutils/crawler/tests/test_meta_passthrough_middleware.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|