├── README.md ├── acculister.py ├── config.py └── requirements.txt /README.md: -------------------------------------------------------------------------------- 1 | # acculister 2 | Cross Listing Software for eBay, PoshMark, Mercari, Depop, FB MarketPlace, Etsy, Grailed, Tradesy 3 | -------------------------------------------------------------------------------- /acculister.py: -------------------------------------------------------------------------------- 1 | from config import keys 2 | from selenium.webdriver import Chrome, ChromeOptions 3 | from selenium.webdriver.common.desired_capabilities import DesiredCapabilities 4 | from selenium.webdriver.common.by import By 5 | from selenium.webdriver.common.keys import Keys 6 | from selenium.webdriver.support.ui import WebDriverWait 7 | from selenium.webdriver.support import expected_conditions as EC 8 | from selenium.common.exceptions import NoAlertPresentException 9 | from selenium.common.exceptions import TimeoutException 10 | 11 | import os, psutil, time, pyperclip, getpass 12 | 13 | 14 | for process in (process for process in psutil.process_iter() if process.name()=="chrome.exe"): 15 | process.kill() 16 | time.sleep(5) 17 | ## 18 | driver_path = r'C:/Windows/chromedriver.exe' 19 | ## 20 | chrome_options = ChromeOptions() 21 | chrome_options.add_argument("--window-size=1080,608") 22 | chrome_options.add_argument("--user-data-dir=C:\\Users\\" + getpass.getuser() + "\\AppData\\Local\\Google\\Chrome\\User Data") 23 | chrome_options.add_argument("start-maximized") 24 | 25 | def order(driver, keys): 26 | driver.get(keys['product_url']) ## go to the product url 27 | driver.switch_to.frame('findprod_iframe') ## switch to the frame where input is 28 | driver.find_element_by_xpath('//*[@id="w0-find-product-search-bar-search-field"]').send_keys(keys['product_title']) ## find the input field and enter product title 29 | driver.find_element_by_xpath('//*[@id="w0-find-product-search-bar-search-button"]').click() ## click on the search button 30 | ##driver.switch_to.default_content() 31 | 32 | try: 33 | WebDriverWait(driver,5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="w0-find-product-2"]/div[2]/button'))).click() ## click on the "Couldn't find Item in Listings" 34 | except(NoAlertPresentException, TimeoutException) as py_ex: 35 | print("Timed out while waiting for Continue button to show") 36 | print(py_ex) 37 | print(py_ex.args) 38 | 39 | time.sleep(5) 40 | 41 | try: 42 | WebDriverWait(driver,10).until(EC.presence_of_element_located((By.XPATH, '//select[@name="itemCondition"]'))).send_keys(keys['item_condition']) ## select item condition. 43 | ## New (N), Open Box (O), Manufacturer Refurbished (M), Seller Refurbished (S), Used (U), For parts, or not working, ( 44 | driver.find_element_by_xpath('//*[@id="itemCondition"]').send_keys(Keys.TAB) 45 | except(NoAlertPresentException, TimeoutException) as py_ex: 46 | print("Page didn't load on time!") 47 | print(py_ex) 48 | print(py_ex.args) 49 | 50 | item_brand = driver.find_element_by_xpath('//*[@id="Listing.Item.ItemSpecific[Brand]"]') ## find the 'Brand' input field 51 | pyperclip.copy(keys['brand']) ## copy the contents of the brand key 52 | item_brand.send_keys(Keys.CONTROL, 'a') ## select everything there 53 | item_brand.send_keys(Keys.CONTROL, 'v') ## and paste in the text in brand 54 | 55 | try: 56 | item_color = keys['color'] 57 | WebDriverWait(driver,3).until(EC.presence_of_element_located((By.XPATH, '//*[@name="_st_Color" and @value=' + item_color + ']'))).click() 58 | time.sleep(3) 59 | WebDriverWait(driver,3).until(EC.presence_of_element_located((By.XPATH, '//*[@name="_st_Color"]'))).send.keys(item_color) 60 | except(NoAlertPresentException, TimeoutException) as py_ex: 61 | print("Checkbox for " + item_color + " color not present after 5 seconds... \n Option select for " + item_color + " proceeding") 62 | print(py_ex) 63 | print(py_ex.args) 64 | 65 | driver.find_element_by_xpath('//*[@id="binPrice"]').send_keys(keys['binPrice']) ## send keys to starting price input field 66 | driver.find_element_by_xpath('//*[@id="pkgLength"]').send_keys(keys['pkgLength']) ## send dimensions for Length 67 | driver.find_element_by_xpath('//*[@id="pkgWidth"]').send_keys(keys['pkgWidth']) ## send dimensions for Width 68 | driver.find_element_by_xpath('//*[@id="pkgHeight"]').send_keys(keys['pkgHeight']) ## send dimensions for Height 69 | 70 | mjuw = driver.find_element_by_xpath('//*[@id="majorUnitWeight"]') 71 | pyperclip.copy(keys['majorUnitWeight']) 72 | mjuw.send_keys(Keys.CONTROL, 'a') 73 | mjuw.send_keys(Keys.CONTROL, 'v') ## send value for major unit of weight 74 | 75 | mnuw = driver.find_element_by_xpath('//*[@id="minorUnitWeight"]') 76 | pyperclip.copy(keys['minorUnitWeight']) 77 | mnuw.send_keys(Keys.CONTROL, 'a') 78 | mnuw.send_keys(Keys.CONTROL, 'v') ## send value for minor unit of weight 79 | 80 | description_area = driver.find_element_by_xpath('//iframe[contains(@id, "txtEdit_st")]') 81 | driver.switch_to.frame(description_area) ## switch to the frame for description 82 | pyperclip.copy(keys['description']) 83 | description_textarea = driver.find_element_by_xpath('/html/body') 84 | description_textarea.send_keys(Keys.CONTROL, 'v') 85 | time.sleep(2) 86 | ## driver.find_element_by_xpath('/html/body').send_keys(keys['description']) ## and enter the description 87 | 88 | driver.switch_to.default_content() 89 | driver.find_element_by_xpath('//*[@id="format"]').send_keys(keys['format']) ## select item condition. 90 | driver.find_element_by_xpath('//*[@id="format"]').send_keys(Keys.TAB) 91 | 92 | 93 | if __name__ == '__main__': 94 | driver = Chrome(executable_path=driver_path, options=chrome_options) 95 | order(driver, keys) 96 | 97 | -------------------------------------------------------------------------------- /config.py: -------------------------------------------------------------------------------- 1 | keys = { 2 | "product_url": "https://bulksell.ebay.com/ws/eBayISAPI.dll?SingleList&forcetool=CUB", 3 | "product_title": "HP Envy dv6 2.5GHz Core i5 Laptop - 8GB RAM 500GB HDD", 4 | "item_condition": "Manufacturer Refurbished", 5 | "color": "Silver", 6 | "binPrice": "350", 7 | "format": "Fixed Price", 8 | "brand": "Hewlett Packard", 9 | "pkgLength": "6.3", 10 | "pkgWidth": "2.4", 11 | "pkgHeight": "0.7", 12 | "majorUnitWeight": 5, 13 | "minorUnitWeight": 3, 14 | "productFormat": "Fixed price", 15 | "description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. \n It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like)." 16 | } -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | selenium==3.141.0 2 | psutil==5.7.0 3 | pyperclip==1.8.0 --------------------------------------------------------------------------------