-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgrailed.py
More file actions
26 lines (22 loc) · 827 Bytes
/
grailed.py
File metadata and controls
26 lines (22 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sys, argparse, time
from bs4 import BeautifulSoup
from selenium import webdriver
from lxml import etree
from helper import percentage
from parse_grailed import soup_parse
from chew_grailed import chewFeed
import pymongo
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db = client.item_database
listings = db.listings
parser = argparse.ArgumentParser("Process list")
parser.add_argument('-l', '--list', nargs='+', type=str, help='<Required> set flag', required=True)
args = parser.parse_args()
designerLst = args.list
designerLst = [name.replace(" ", "-").lower().split(",") for name in designerLst]
designerLst = designerLst[0] #list is within a list, so have to extract it like this
print(designerLst)
for designer in designerLst:
output = chewFeed(designer)
soup_parse(db, output)