|
|
@ -1,14 +1,88 @@ |
|
|
|
__author__ = 'DarkWeb' |
|
|
|
|
|
|
|
# Here, we are importing the auxiliary functions to clean or convert data |
|
|
|
from typing import List, Tuple |
|
|
|
from MarketPlaces.Utilities.utilities import * |
|
|
|
|
|
|
|
# Here, we are importing BeautifulSoup to search through the HTML tree |
|
|
|
from bs4 import BeautifulSoup |
|
|
|
|
|
|
|
|
|
|
|
def mikesGrandStore_description_parser(soup: BeautifulSoup): |
|
|
|
pass |
|
|
|
def mikesGrandStore_description_parser(soup: BeautifulSoup) -> Tuple: |
|
|
|
|
|
|
|
name = "-1" # 0 Product_Name |
|
|
|
describe = "-1" # 1 Product_Description |
|
|
|
lastSeen = "-1" # 2 Product_LastViewDate |
|
|
|
rules = "-1" # 3 NOT USED ... |
|
|
|
CVE = "-1" # 4 Product_CVE_Classification (Common Vulnerabilities and Exposures) |
|
|
|
MS = "-1" # 5 Product_MS_Classification (Microsoft Security) |
|
|
|
review = "-1" # 6 Product_Number_Of_Reviews |
|
|
|
category = "-1" # 7 Product_Category |
|
|
|
shipFrom = "-1" # 8 Product_ShippedFrom |
|
|
|
shipTo = "-1" # 9 Product_ShippedTo |
|
|
|
left = "-1" # 10 Product_QuantityLeft |
|
|
|
escrow = "-1" # 11 Vendor_Warranty |
|
|
|
terms = "-1" # 12 Vendor_TermsAndConditions |
|
|
|
vendor = "-1" # 13 Vendor_Name |
|
|
|
sold = "-1" # 14 Product_QuantitySold |
|
|
|
addDate = "-1" # 15 Product_AddedDate |
|
|
|
available = "-1" # 16 NOT USED ... |
|
|
|
endDate = "-1" # 17 NOT USED ... |
|
|
|
BTC = "-1" # 18 Product_BTC_SellingPrice |
|
|
|
USD = "-1" # 19 Product_USD_SellingPrice |
|
|
|
rating = "-1" # 20 Vendor_Rating |
|
|
|
success = "-1" # 21 Vendor_Successful_Transactions |
|
|
|
EURO = "-1" # 22 Product_EURO_SellingPrice |
|
|
|
|
|
|
|
|
|
|
|
name: str = soup.find("h1", {"class": "product-title product_title entry-title"}).text |
|
|
|
|
|
|
|
describe = soup.find("div", {"id": "tab-description"}).text |
|
|
|
|
|
|
|
commentsList: List[BeautifulSoup] = soup.find("ol", {"class": "commentlist"}).find_all("li") |
|
|
|
|
|
|
|
if len(commentsList) > 0: |
|
|
|
lastReview: BeautifulSoup = commentsList[0] |
|
|
|
lastSeen = lastReview.find("time").get("datetime").text |
|
|
|
|
|
|
|
reviewTab: str = soup.find('a', {'href': '#tab-reivews'}).text |
|
|
|
review = reviewTab.split('(')[1].split(')')[0] |
|
|
|
|
|
|
|
navbarBreadcrumbs: List[BeautifulSoup] = soup.find('nav', {'class': 'woocommerce-breadcrumb breadcrumbs '}).find_all('a') |
|
|
|
category = navbarBreadcrumbs[1].text |
|
|
|
|
|
|
|
USD = soup.find("div", {"class": "price-wrapper"}).text |
|
|
|
|
|
|
|
reviewStats: str = soup.find("div", {"class": "star-rating"}).text |
|
|
|
rating = reviewStats.split(' ')[1] |
|
|
|
|
|
|
|
row = ( |
|
|
|
name, |
|
|
|
describe, |
|
|
|
lastSeen, |
|
|
|
rules, |
|
|
|
CVE, |
|
|
|
MS, |
|
|
|
review, |
|
|
|
category, |
|
|
|
shipFrom, |
|
|
|
shipTo, |
|
|
|
left, |
|
|
|
escrow, |
|
|
|
terms, |
|
|
|
vendor, |
|
|
|
sold, |
|
|
|
addDate, |
|
|
|
available, |
|
|
|
endDate, |
|
|
|
BTC, |
|
|
|
USD, |
|
|
|
rating, |
|
|
|
success, |
|
|
|
EURO |
|
|
|
) |
|
|
|
|
|
|
|
return row |
|
|
|
|
|
|
|
|
|
|
|
def mikesGtrandStore_listing_parser(soup: BeautifulSoup): |
|
|
|