Changeset 47f4eaf for phonelux_scrappers/phones_image_setter.py
- Timestamp:
- 11/20/22 16:34:52 (2 years ago)
- Branches:
- master
- Parents:
- ffd50db
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
phonelux_scrappers/phones_image_setter.py
rffd50db r47f4eaf 13 13 offers = list(json.loads(requests.get('http://localhost:8080/phones/offers/' + phone_id).text)) 14 14 15 offers = list(filter(lambda offer: offer['image_url'] is not None, offers)) 15 # remove mobitech condition 16 offers = list(filter(lambda offer: offer['image_url'] is not None and 'mobitech' not in offer['image_url'] 17 , offers)) 16 18 17 19 image_url = None 18 20 21 if len(offers) > 1: 22 image_url = offers[1]['image_url'] 23 19 24 if len(offers) > 0: 20 25 image_url = offers[0]['image_url'] 26 27 # print('phone :'+str(phone)) 28 # print(image_url) 29 # print('------------------------------') 21 30 22 31 phone['image_url'] = image_url
Note:
See TracChangeset
for help on using the changeset viewer.