|
|
@ -31,6 +31,8 @@ def tor2door_description_parser(soup): |
|
|
|
left = "-1" # 16 Product_QuantityLeft |
|
|
|
shipFrom = "-1" # 17 Product_ShippedFrom |
|
|
|
shipTo = "-1" # 18 Product_ShippedTo |
|
|
|
image = "-1" # 19 Product_Image |
|
|
|
vendor_image = "-1" # 20 Vendor_Image |
|
|
|
|
|
|
|
bae = soup.find('div', {'class': "col-9"}) |
|
|
|
|
|
|
@ -106,9 +108,12 @@ def tor2door_description_parser(soup): |
|
|
|
MS = MS.replace(',', ' ') |
|
|
|
MS = MS.replace('\n', '') |
|
|
|
|
|
|
|
image = bae.find('div', {"class": "product-primary"}).find('img') |
|
|
|
image = image.get('src').split('base64,')[-1] |
|
|
|
|
|
|
|
# Populating the final variable (this should be a list with all fields scraped) |
|
|
|
row = (vendor, rating_vendor, success, name, describe, CVE, MS, category, views, reviews, rating_item, addDate, |
|
|
|
BTC, USD, EURO, sold, left, shipFrom, shipTo) |
|
|
|
BTC, USD, EURO, sold, left, shipFrom, shipTo, image, vendor_image) |
|
|
|
|
|
|
|
# Sending the results |
|
|
|
return row |
|
|
@ -139,7 +144,9 @@ def tor2door_listing_parser(soup): |
|
|
|
qLeft =[] # 17 Product_QuantityLeft |
|
|
|
shipFrom = [] # 18 Product_ShippedFrom |
|
|
|
shipTo = [] # 19 Product_ShippedTo |
|
|
|
href = [] # 20 Product_Links |
|
|
|
image = [] # 20 Product_Image |
|
|
|
image_vendor = [] # 21 Vendor_Image |
|
|
|
href = [] # 22 Product_Links |
|
|
|
|
|
|
|
listing = soup.findAll('div', {"class": "card product-card mb-3"}) |
|
|
|
|
|
|
@ -181,6 +188,15 @@ def tor2door_listing_parser(soup): |
|
|
|
usd = usd.strip() |
|
|
|
USD.append(usd) |
|
|
|
|
|
|
|
# Finding Rating |
|
|
|
stars = card.find("ul", {"class": "star-list"}) |
|
|
|
full = stars.findAll('i', {"class": "fas fa-star star star-active"}) |
|
|
|
half = stars.find('i', {"class": "fas fa-star-half star star-active"}) |
|
|
|
rating = len(full) |
|
|
|
if half is not None: |
|
|
|
rating += 0.5 |
|
|
|
rating_item.append(str(rating)) |
|
|
|
|
|
|
|
# Finding Reviews |
|
|
|
num = card.find("span", {"class": "rate-count"}).text |
|
|
|
num = num.replace("(", "") |
|
|
@ -216,9 +232,12 @@ def tor2door_listing_parser(soup): |
|
|
|
MSValue=me |
|
|
|
MS.append(MSValue) |
|
|
|
|
|
|
|
image = bae[0].find('img') |
|
|
|
image = image.get('src').split('base64,')[-1] |
|
|
|
|
|
|
|
# Populate the final variable (this should be a list with all fields scraped) |
|
|
|
return organizeProducts(mktName, nm, vendor, rating_vendor, success, name, CVE, MS, category, describe, views, |
|
|
|
reviews, rating_item, addDate, BTC, USD, EURO, sold, qLeft, shipFrom, shipTo, href) |
|
|
|
reviews, rating_item, addDate, BTC, USD, EURO, sold, qLeft, shipFrom, shipTo, href, image, image_vendor) |
|
|
|
|
|
|
|
|
|
|
|
def tor2door_links_parser(soup): |
|
|
|