Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update person.py #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions linkedin_scraper/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def get_experiences(self):
self.scroll_to_bottom()
main_list = self.wait_for_element_to_load(name="pvs-list", base=main)
for position in main_list.find_elements(By.XPATH,"li"):
position = position.find_element(By.CLASS_NAME,"pvs-entity")
# position = position.find_element(By.CLASS_NAME,"pvs-entity")
position = position.find_element(By.CLASS_NAME,"pvs-entity--padded")
company_logo_elem, position_details = position.find_elements(By.XPATH,"*")

# company elem
Expand Down Expand Up @@ -240,9 +241,16 @@ def get_educations(self):
self.add_education(education)

def get_name_and_location(self):
top_panels = self.driver.find_elements(By.CLASS_NAME,"pv-text-details__left-panel")
# top_panels = self.driver.find_elements(By.CLASS_NAME,"pv-text-details__left-panel")
# self.name = top_panels[0].find_elements(By.XPATH,"*")[0].text
# self.location = top_panels[1].find_element(By.TAG_NAME,"span").text

top_panels = self.driver.find_elements(By.CLASS_NAME,"pv-text-details__about-this-profile-entrypoint")
self.name = top_panels[0].find_elements(By.XPATH,"*")[0].text
self.location = top_panels[1].find_element(By.TAG_NAME,"span").text
try:
self.location = self.driver.find_element(By.XPATH, '//*[@class="artdeco-card ember-view pv-top-card"]/div[2]/div[2]/div[2]/span[1]').text
except NoSuchElementException:
self.location = "Fail"


def get_about(self):
Expand Down