MatthewChatham / glassdoor-review-scraper

Scrape reviews from Glassdoor
BSD 2-Clause "Simplified" License
180 stars 252 forks source link

getting the pros and cons back #19

Closed tsp2123 closed 5 years ago

tsp2123 commented 5 years ago

Hey Matt, thanks for your help. I'm trying to tinker and get the pros and cons back and running with no real luck right now. Any help?

` def scrape_pros(review): try: pros = review.find_element_by_xpath('//*[@id="empReview_28156727"]/div/div[2]/div[2]/div[4]') expand_show_more(pros) res = pros.text.replace('\nShow Less', '') except Exception: res = np.nan return res

def scrape_cons(review):
    try:
        cons = review.find_element_by_xpath('//*[@id="empReview_28156727"]/div/div[2]/div[2]/div[5]')
        expand_show_more(cons)
        res = cons.text.replace('\nShow Less', '')
    except Exception:
        res = np.nan
    return res`