|
|
@ -43,6 +43,12 @@ def blackpyramid_description_parser(soup): |
|
|
|
name = name.replace(",", "") |
|
|
|
name = name.strip() |
|
|
|
|
|
|
|
# Finding Product Rating |
|
|
|
rating_span = soup.find('span', {'class': 'to3098503t'}).find_next_sibling('span') |
|
|
|
rating_num = rating_span.find('b').text |
|
|
|
if rating_num != 'N/A': |
|
|
|
rating_item = rating_num[0:3] |
|
|
|
|
|
|
|
# product description |
|
|
|
describe = soup.findAll('div', {'class': 'fer048953'})[1].text |
|
|
|
describe = describe.replace('\n', ' ') |
|
|
@ -57,11 +63,11 @@ def blackpyramid_description_parser(soup): |
|
|
|
vendor = vendor.replace(",", "") |
|
|
|
vendor = vendor.strip() |
|
|
|
|
|
|
|
# Finding Vendor Rating |
|
|
|
rating_span = soup.find('span', {'class': 'to3098503t'}).find_next_sibling('span') |
|
|
|
rating_num = rating_span.find('b').text |
|
|
|
if rating_num != 'N/A': |
|
|
|
rating = rating_num[0:3] |
|
|
|
# Finding Product Rating |
|
|
|
rating_div = soup.find('div', {'class': 'bold03905 vstat364'}).find_next_sibling('div').find_next_sibling('div') |
|
|
|
rating_vendor = cleanNumbers(rating_div.text) |
|
|
|
if rating_vendor == "": |
|
|
|
rating_vendor = "-1" |
|
|
|
|
|
|
|
# Finding Successful Transactions |
|
|
|
success_container = soup.find('ul', {'class': 'ul3o00953'}).findAll('li')[1] |
|
|
@ -102,7 +108,7 @@ def blackpyramid_description_parser(soup): |
|
|
|
positive = soup.find('span', {'class': 'ar04999324'}).text |
|
|
|
neutral = soup.find('span', {'class': 'ti9400005 can39953'}).text |
|
|
|
negative = soup.find('span', {'class': 'ti9400005 ti90088 can39953'}).text |
|
|
|
review = int(positive) + int(neutral) + int(negative) |
|
|
|
reviews = int(positive) + int(neutral) + int(negative) |
|
|
|
|
|
|
|
# Finding product image |
|
|
|
image = soup.find('img', {'class': 'img0390503'}) |
|
|
@ -147,7 +153,7 @@ def blackpyramid_listing_parser(soup): |
|
|
|
|
|
|
|
# Fields to be parsed |
|
|
|
nm = 0 # *Total_Products (Should be Integer) |
|
|
|
mktName = "Black Pyramid" # 0 *Marketplace_Name |
|
|
|
mktName = "BlackPyramid" # 0 *Marketplace_Name |
|
|
|
vendor = [] # 1 *Vendor y |
|
|
|
rating_vendor = [] # 2 Vendor_Rating |
|
|
|
success = [] # 3 Vendor_Successful_Transactions |
|
|
@ -196,14 +202,14 @@ def blackpyramid_listing_parser(soup): |
|
|
|
product = product.strip() |
|
|
|
name.append(product) |
|
|
|
|
|
|
|
# Finding description |
|
|
|
# 'recurisve = False' only searches direct children |
|
|
|
desc = card.findChildren('div', recursive=False)[0] |
|
|
|
desc = desc.findAll('div', recursive=False)[3].text |
|
|
|
desc = desc.replace('\n', ' ') |
|
|
|
desc = desc.replace(",", "") |
|
|
|
desc = desc.strip() |
|
|
|
describe.append(desc) |
|
|
|
# # Finding description |
|
|
|
# # 'recurisve = False' only searches direct children |
|
|
|
# desc = card.findChildren('div', recursive=False)[0] |
|
|
|
# desc = desc.findAll('div', recursive=False)[3].text |
|
|
|
# desc = desc.replace('\n', ' ') |
|
|
|
# desc = desc.replace(",", "") |
|
|
|
# desc = desc.strip() |
|
|
|
# describe.append(desc) |
|
|
|
|
|
|
|
# Finding Vendor Name |
|
|
|
vendor_name = bae[4].find('span').text |
|
|
|