|
|
@ -147,27 +147,29 @@ def hiddenmarket_listing_parser(soup): |
|
|
|
shipTo = [] # 19 Product_ShippedTo |
|
|
|
href = [] # 20 Product_Links |
|
|
|
|
|
|
|
listing = soup.findAll('div', {"class": "info"}) |
|
|
|
listing = soup.findAll('div', {"class": "item"}) |
|
|
|
|
|
|
|
# Populating the Number of Products |
|
|
|
nm = len(listing) |
|
|
|
|
|
|
|
# Finding Category |
|
|
|
cat = soup.find("div", {'class': "heading"}).text |
|
|
|
cat = cat.replace(",", "") |
|
|
|
cat = cat.strip() |
|
|
|
# cat = soup.find("div", {'class': "heading"}).text |
|
|
|
# cat = cat.replace(",", "") |
|
|
|
# cat = cat.strip() |
|
|
|
|
|
|
|
for card in listing: |
|
|
|
category.append(cat) |
|
|
|
# category.append(cat) |
|
|
|
|
|
|
|
|
|
|
|
# Adding the url to the list of urls |
|
|
|
link = card.find_all('a') |
|
|
|
link = link[1].get('href') |
|
|
|
|
|
|
|
# Adding the url to the list of urls TODO: fix this |
|
|
|
link = card.next_sibling |
|
|
|
link.find('a').get('href') |
|
|
|
href.append(link) |
|
|
|
|
|
|
|
# Finding Product Name |
|
|
|
product = card.next_sibling.find('div', {'class': "title"}).find('a').text |
|
|
|
product = card.next_sibling.find('div', {'class': "title"}) |
|
|
|
product = product.text |
|
|
|
product = product.replace('\n', ' ') |
|
|
|
product = product.replace(",", "") |
|
|
|
product = product.strip() |
|
|
@ -185,7 +187,8 @@ def hiddenmarket_listing_parser(soup): |
|
|
|
usd = usd.strip() |
|
|
|
USD.append(usd) |
|
|
|
|
|
|
|
tb = card.next_sibling.find("span", {"class": "stats"}).find_all('td') |
|
|
|
tb = card.next_sibling.find("div", {"class": "stats"}) |
|
|
|
tb = tb.find_all('td') |
|
|
|
|
|
|
|
# Finding Reviews |
|
|
|
num = tb[-1].text |
|
|
@ -193,11 +196,11 @@ def hiddenmarket_listing_parser(soup): |
|
|
|
reviews.append(num) |
|
|
|
|
|
|
|
# Finding Views |
|
|
|
view = tb[0].text.strip() |
|
|
|
view = tb[-3].text.strip() |
|
|
|
views.append(view) |
|
|
|
|
|
|
|
# Finding Num of Sales |
|
|
|
sale = tb[1].text.strip() |
|
|
|
sale = tb[-2].text.strip() |
|
|
|
sold.append(sale) |
|
|
|
|
|
|
|
# Finding shipping info |
|
|
@ -209,7 +212,7 @@ def hiddenmarket_listing_parser(soup): |
|
|
|
destination = shipping[1].strip() |
|
|
|
shipTo.append(destination) |
|
|
|
|
|
|
|
# Finding description |
|
|
|
# Finding description (site only shows partial description on listing pages) |
|
|
|
description = card.next_sibling.find('div', {'class': "description"}).text |
|
|
|
description = description.replace("\n", " ") |
|
|
|
description = description.replace("\r", " ") |
|
|
|