|
@@ -86,7 +86,7 @@ class YyjztSpider:
|
|
|
self.product_brand = self.task_dict.get("product_brand", "")
|
|
self.product_brand = self.task_dict.get("product_brand", "")
|
|
|
self.keyword = (
|
|
self.keyword = (
|
|
|
self.task_dict.get("product_keyword", "")
|
|
self.task_dict.get("product_keyword", "")
|
|
|
- or (self.task_dict.get("product_brand", "") + " " + self.product_name + " " + self.product_specs).strip()
|
|
|
|
|
|
|
+ or (self.task_dict.get("product_brand", "").strip() + " " + self.product_name.strip() + " " + self.product_specs.strip()).strip()
|
|
|
).strip()
|
|
).strip()
|
|
|
self.sampling_cycle = self.task_dict.get("sampling_cycle", "")
|
|
self.sampling_cycle = self.task_dict.get("sampling_cycle", "")
|
|
|
self.sampling_start_time = self.task_dict.get("sampling_start_time", "")
|
|
self.sampling_start_time = self.task_dict.get("sampling_start_time", "")
|
|
@@ -372,10 +372,10 @@ class YyjztSpider:
|
|
|
|
|
|
|
|
brand_ok = True
|
|
brand_ok = True
|
|
|
name_ok = True
|
|
name_ok = True
|
|
|
- if self.product_brand:
|
|
|
|
|
- brand_ok = self.product_brand in str(product_brand)
|
|
|
|
|
- if self.product_name:
|
|
|
|
|
- name_ok = self.product_name in str(product_name)
|
|
|
|
|
|
|
+ if self.product_brand.strip():
|
|
|
|
|
+ brand_ok = self.product_brand.strip() in str(product_brand)
|
|
|
|
|
+ if self.product_name.strip():
|
|
|
|
|
+ name_ok = self.product_name.strip() in str(product_name)
|
|
|
return brand_ok and name_ok
|
|
return brand_ok and name_ok
|
|
|
|
|
|
|
|
def search_data(self):
|
|
def search_data(self):
|