|
@ -38,42 +38,20 @@ def city_description_parser(soup): |
|
|
vendor_image = "-1" # 20 Vendor_Image |
|
|
vendor_image = "-1" # 20 Vendor_Image |
|
|
|
|
|
|
|
|
divmd7 = soup.find('div', {'class': "col-md-7"}) |
|
|
divmd7 = soup.find('div', {'class': "col-md-7"}) |
|
|
ptag = soup.findAll('p') |
|
|
|
|
|
|
|
|
|
|
|
# Finding Product Name |
|
|
|
|
|
# NA |
|
|
|
|
|
|
|
|
|
|
|
# Finding Vendor |
|
|
# Finding Vendor |
|
|
vendor = divmd7.find('a').text.strip() |
|
|
vendor = divmd7.find('a').text.strip() |
|
|
|
|
|
|
|
|
# Finding Vendor Rating |
|
|
|
|
|
# NA |
|
|
|
|
|
|
|
|
|
|
|
# Finding Successful Transactions |
|
|
|
|
|
success = soup.find('span', {'class': "badge-primary"}) |
|
|
|
|
|
|
|
|
|
|
|
# Finding Prices |
|
|
# Finding Prices |
|
|
USD = soup.find('span', {'class': "total"}).text.strip() |
|
|
USD = soup.find('span', {'class': "total"}).text.strip() |
|
|
|
|
|
|
|
|
BTC = soup.find('div', {'class': "text-center"}).text.strip() |
|
|
|
|
|
|
|
|
|
|
|
# Finding Escrow |
|
|
|
|
|
escrow = ptag[-1].text.strip() |
|
|
|
|
|
|
|
|
|
|
|
# Finding the Product Category |
|
|
|
|
|
category = ptag[-2].text.strip() |
|
|
|
|
|
|
|
|
|
|
|
# Finding the Product Quantity Available |
|
|
|
|
|
# NA |
|
|
|
|
|
|
|
|
|
|
|
# Finding Number Sold |
|
|
|
|
|
# NA |
|
|
|
|
|
|
|
|
tempBTC = soup.find('div', {'class': "text-center"}).text.strip() |
|
|
|
|
|
BTC = tempBTC.replace("BTC", "").strip() |
|
|
|
|
|
|
|
|
# Finding Shipment Information (Origin) |
|
|
|
|
|
# NA |
|
|
|
|
|
|
|
|
|
|
|
# Finding Shipment Information (Destination) |
|
|
|
|
|
# NA |
|
|
|
|
|
|
|
|
# Finding Product Image |
|
|
|
|
|
image = soup.find('img', {'class': 'img-fluid'}) |
|
|
|
|
|
image = image.get('src') |
|
|
|
|
|
image = image.split('base64,')[-1] |
|
|
|
|
|
|
|
|
# Finding the Product description |
|
|
# Finding the Product description |
|
|
describe = soup.find('div', {'class': "text-white"}).text |
|
|
describe = soup.find('div', {'class': "text-white"}).text |
|
@ -150,7 +128,7 @@ def city_listing_parser(soup): |
|
|
image_vendor = [] # 21 Vendor_Image |
|
|
image_vendor = [] # 21 Vendor_Image |
|
|
href = [] # 22 Product_Links |
|
|
href = [] # 22 Product_Links |
|
|
|
|
|
|
|
|
listing = soup.findAll('div', {"class": "card"}) |
|
|
|
|
|
|
|
|
listing = soup.findAll('div', {"class": "p-4"}) |
|
|
|
|
|
|
|
|
# Populating the Number of Products |
|
|
# Populating the Number of Products |
|
|
nm = len(listing) |
|
|
nm = len(listing) |
|
@ -163,7 +141,12 @@ def city_listing_parser(soup): |
|
|
link = cleanLink(link) |
|
|
link = cleanLink(link) |
|
|
href.append(link) |
|
|
href.append(link) |
|
|
|
|
|
|
|
|
# Finding the Product |
|
|
|
|
|
|
|
|
# Category |
|
|
|
|
|
tempCategory = soup.find('select', {"name": "category"}) |
|
|
|
|
|
tempCategory = tempCategory.find('option', selected=True).text.strip() |
|
|
|
|
|
category.append(tempCategory) |
|
|
|
|
|
|
|
|
|
|
|
# Product Name |
|
|
product = a.find('h4', {"class": "text-center"}).text |
|
|
product = a.find('h4', {"class": "text-center"}).text |
|
|
product = product.replace('\n', ' ') |
|
|
product = product.replace('\n', ' ') |
|
|
product = product.replace(",", "") |
|
|
product = product.replace(",", "") |
|
@ -171,9 +154,7 @@ def city_listing_parser(soup): |
|
|
product = product.strip() |
|
|
product = product.strip() |
|
|
name.append(product) |
|
|
name.append(product) |
|
|
|
|
|
|
|
|
bae = a.find('div', {'class': "media-content"}).find('div').find_all('div') |
|
|
|
|
|
|
|
|
|
|
|
# Finding Prices |
|
|
|
|
|
|
|
|
# USD and BTC Price |
|
|
price = a.find('div', {"class": "price"}).text |
|
|
price = a.find('div', {"class": "price"}).text |
|
|
tempUSD = price.split("~")[0] |
|
|
tempUSD = price.split("~")[0] |
|
|
tempUSD = tempUSD.replace("$", "") |
|
|
tempUSD = tempUSD.replace("$", "") |
|
@ -185,17 +166,11 @@ def city_listing_parser(soup): |
|
|
tempBTC = tempBTC.strip() |
|
|
tempBTC = tempBTC.strip() |
|
|
BTC.append(tempBTC) |
|
|
BTC.append(tempBTC) |
|
|
|
|
|
|
|
|
# Finding the Vendor |
|
|
|
|
|
# NA |
|
|
|
|
|
|
|
|
|
|
|
# Finding the Category |
|
|
|
|
|
# NA |
|
|
|
|
|
|
|
|
|
|
|
# Finding Number Sold and Quantity Left |
|
|
|
|
|
# NA |
|
|
|
|
|
|
|
|
|
|
|
# Finding Successful Transactions |
|
|
|
|
|
# NA |
|
|
|
|
|
|
|
|
# Img |
|
|
|
|
|
product_image = a.find('img') |
|
|
|
|
|
product_image = product_image.get('src') |
|
|
|
|
|
product_image = product_image.split('base64,')[-1] |
|
|
|
|
|
image.append(product_image) |
|
|
|
|
|
|
|
|
# Searching for CVE and MS categories |
|
|
# Searching for CVE and MS categories |
|
|
cve = a.findAll(text=re.compile('CVE-\d{4}-\d{4}')) |
|
|
cve = a.findAll(text=re.compile('CVE-\d{4}-\d{4}')) |
|
|