简体   繁体   中英

Scraping profile urls on LinkedIn using selenium

I have a CSV file full of candidate names and I want to extract their LinkedIn Profile URLs. I have automated login using selenium and taken name input from CSV and clicked the search button but am unable to access the profile URLs on the page. For eg: I want to scrape profile URLs on the following Linkedin page but it is returning nothing when I query the following:

The link: https://www.linkedin.com/search/results/all/?keywords=April%20Siose&origin=GLOBAL_SEARCH_HEADER

driver.find_element_by_class_name("search-result__result-link ember-view").get_attribute("href")

It seems the site requires you to login in before it shows the desired page. The driver libary may have a auth feature or something similar to log in automatically

linkedin_urls = [url.get_attribute("href") for url in linkedin_urls]

this is the command in selenium to extract the LinkedIn profile's URLs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM