jmausolf / poshmark_sharing

BSD 3-Clause "New" or "Revised" License
111 stars 58 forks source link

Accesses closet successfully, doesn't share #36

Open laurenfields opened 2 years ago

laurenfields commented 2 years ago

Hi! I have been trying to get this script to work. It is able to successfully sign me in, nagivate to my closet, scroll to the bottom of

[*] the share war will continue in 120 minutes...
    current time: 08:00PM on Aug 31, 2022

I have ensured that the username provided is not my email address. How should I address this?

Thanks!

anniebritton commented 1 year ago

Hi, try using this code below in your script, provided by cbrown83 here.

def get_closet_share_icons():
    item_pat = "//div[@class='social-info social-actions d-fl ai-c jc-c']"
    items = driver.find_elements_by_xpath(item_pat)
    share_icons = [i.find_element_by_css_selector("a[class='share']") for i in items]
    if not share_icons:
        item_pat = "//div[@class='d--fl ai--c social-action-bar__action social-action-bar__share']"
        items = driver.find_elements_by_xpath(item_pat)
        share_icons = [i.find_element_by_css_selector(".share-gray-large") for i in items]
    return share_icons

def clicks_share_followers(share_icon, d=4.5):

    ## First share click
    driver.execute_script("arguments[0].click();", share_icon); time.sleep(rt(d))

    ## Second share click
    try:
        share_pat = "//a[@class='pm-followers-share-link grey']"
        share_followers = driver.find_element_by_xpath(share_pat)
        driver.execute_script("arguments[0].click();", share_followers); time.sleep(rt(d))
    except:
        share_pat = "//a[@class='internal-share__link']"
        share_followers = driver.find_element_by_xpath(share_pat)
        driver.execute_script("arguments[0].click();", share_followers); time.sleep(rt(d))
yaelsprikut commented 1 year ago

@anniebritton This worked for me. Thanks!