LinkedIn | Website | GitHub | Contact Info
This script is designed for users with a seller account on Poshmark marketplace.
poshamatic
's primary functionalities include:
- automated sharing of the listings for every item in your closet with all subscribers, or
- automated sharing of all the listings of another Poshmark account.
Once the script is executed, it will share the requested listings every 120 minutes.
To install Python3
requirements, you may run pip install -r requirements.txt
.
You will also need a recent version of Firefox
(or another webdriver of your choice).
- If using
Firefox
, you will also likely need to installGeckoDriverManager
, which on macOS can be accomplished using Homebrew with the commandbrew install geckodriver
in terminal.- If using
Edge
, you will need to installEdgeChromiumDriverManager
.
First clone the repository in terminal:
git clone https://github.com/lyndskg/posh-a-matic
Change directories to enter the local repository:
cd posh-a-matic
You will need to create a credentials.py
file.
It is recommended to simply edit the example_credentials.py
file and rename it.
poshmark_username = "poshmarkusername"
poshmark_password = "poshmarkpassword"
Edit the text in quotes to your actual username and password. Save the file and rename it credentials.py
.
Assuming you are in the repo directory, the
bash
command would bemv example_credentials.py credentials.py
.
The default webdriver for this script is Chrome
, which was the original web browser used in writing this script and executing the code.
From a development perspective Chrome
offers a better interface to inspect the HTML code needed in writing the scraper.
However, other webdrivers, e.g. Safari
, Firefox
, and/or Edge
may be used.
To learn more about setting up the appropriate web driver, visit the Selenium web driver documentation here.
In terminal run the following command: python share.py
, which will run the script with the default options (see below).
Note: If you have several versions of python
, you will need to amend the above line to run your python3 alias, e.g. python3 share.py
.
There are a variety of optional arguments for the script, including timing, closet scroll size, closet ordering, the account to share, and the webdriver.
To display the full range of command line arguments type python3 share.py --help
or python3 share.py -help
.
For convenience, these options are described below.
You can adjust the timing from the command line. The default is 7200 seconds (120 minutes or 2 hours).
Using a shorter time period is not recommended as it will be more likely caught by both captcha (I am not a robot
) detection systems either at login or during the actual sharing.
Here are some examples:
- Every four hours:
python3 share.py -t 14400
- Every two hours:
python3 share.py -t 7200
The latest version of this code will automatically scroll to the end of your active listings in your closet. You should no longer need to adjust the number of possible scrolls (default, n
= 1000).
If you desired to share only part of your closet, you could descrease the number of scrolls with the -n
parameter:
python3 share.py -n 1
Note: The code above scrolls only 1 time.
To preserve closet order, the closet items must be shared in their reverse order. To this end, the default sorting is order=True
:
Preserve Closet Order:
python3 share.py
python3 share.py -o True
To override this option, you can reverse order the items of the closet with the following flag, -o False
:
- Reverse Original Closet Order:
python3 share.py -o False
By default, the code will share all the listings for Poshmark account provided in credentials.py
.
While you will still need your account information in credentials.py
to login, you may request that the code share the listings of another Poshmark user with the account option: python3 share.py -a another_poshmark_closet
.
This can be a useful feature, for example, in becoming a Poshmark ambassador.
Since the code is setup to run on a loop (by default every two hours), a safeguard is put in place to confirm that you actually want to share another users account.
This will appear in the terminal:
[*] you have requested to share
the items in another poshmark closet:
------------------------------------
[*]: another_poshmark_closet
------------------------------------
[*] to confirm this request, enter [y]
to cancel and share your closet items instead enter [n] :
y
Note: This prompt will occur each time the code runs.
If you are confident you want to repeatedly share another users entire closet every few hours, you can bypass this prompt with the following command line option b True
.
If you would prefer to not share your entire closet (or another account's entire closet), you may select to share a randomly selected subset of items from all possible active items.
To do so, add the parameter -r
followed by a number to your command in the terminal:
python3 share.py -a another_poshmark_closet -r 25
This shares 25 randomly selected items from another closet.
This functionality is helpful if you would like to share some of another person's closet, but not every item they have.
Alternative Selenium
web drivers may also be specified. Drivers may be called by entering their name, e.g. -d Firefox
or -d Chrome
or alternatively referring to the numerical shortcut for those options, e.g. -d 0
or -d 1
.
The full list of driver names and options is as follows:
Chrome
== 0Safari
== 1Firefox
== 2Edge
== 3
These must be properly installed on your system, otherwise you will encounter an error.
See here for further details.