From 6806ba56a55fbb2748dc46ead9b47ae374e3a608 Mon Sep 17 00:00:00 2001 From: Eaglesight02 Date: Sun, 31 Dec 2023 15:34:52 +0530 Subject: [PATCH] Changed __TOP_CARD and get_name_and_location function in Person.py --- linkedin_scraper/person.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linkedin_scraper/person.py b/linkedin_scraper/person.py index 86d169e..97623a7 100644 --- a/linkedin_scraper/person.py +++ b/linkedin_scraper/person.py @@ -11,7 +11,7 @@ class Person(Scraper): - __TOP_CARD = "pv-top-card" + __TOP_CARD = "scaffold-layout__main" __WAIT_FOR_ELEMENT_TIMEOUT = 5 def __init__( @@ -240,9 +240,9 @@ 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") - self.name = top_panels[0].find_elements(By.XPATH,"*")[0].text - self.location = top_panels[1].find_element(By.TAG_NAME,"span").text + top_panel = self.__TOP_CARD.find_element(By.CLASS_NAME, ".mt2.relative") + self.name = top_panel.find_element(By.TAG_NAME, "h1").text + self.location = top_panel.find_element(By.CLASS_NAME,".text-body-small.inline.t-black--light.break-words").text def get_about(self):