From 5c737d4bb2dfe65c5772fe7668592f5fbea9a1bf Mon Sep 17 00:00:00 2001 From: Swagato Bag Date: Sun, 26 Mar 2023 23:13:50 +0530 Subject: [PATCH 1/7] Altered functions with updated ones --- linkedin_scraper/person.py | 72 ++++++++++++++++++-------------------- samples/scrape_person.py | 22 +++++++++--- 2 files changed, 52 insertions(+), 42 deletions(-) diff --git a/linkedin_scraper/person.py b/linkedin_scraper/person.py index 052dd69..b5e3f09 100644 --- a/linkedin_scraper/person.py +++ b/linkedin_scraper/person.py @@ -6,8 +6,6 @@ from selenium.common.exceptions import NoSuchElementException from .objects import Experience, Education, Scraper, Interest, Accomplishment, Contact import os -from linkedin_scraper import selectors - class Person(Scraper): @@ -102,7 +100,7 @@ def _click_see_more_by_class_name(self, class_name): def is_open_to_work(self): try: - return "#OPEN_TO_WORK" in self.driver.find_element_by_class_name("pv-top-card-profile-picture").find_element_by_tag_name("img").get_attribute("title") + return "#OPEN_TO_WORK" in self.driver.find_element(By.CLASS_NAME,"pv-top-card-profile-picture").find_element(By.TAG_NAME,"img").get_attribute("title") except: return False @@ -114,35 +112,35 @@ def get_experiences(self): self.scroll_to_half() 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") - company_logo_elem, position_details = position.find_elements_by_xpath("*") + for position in main_list.find_elements(By.XPATH,"li"): + position = position.find_element(By.CLASS_NAME,"pvs-entity") + company_logo_elem, position_details = position.find_elements(By.XPATH,"*") # company elem - company_linkedin_url = company_logo_elem.find_element_by_xpath("*").get_attribute("href") + company_linkedin_url = company_logo_elem.find_element(By.XPATH,"*").get_attribute("href") # position details - position_details_list = position_details.find_elements_by_xpath("*") + position_details_list = position_details.find_elements(By.XPATH,"*") position_summary_details = position_details_list[0] if len(position_details_list) > 0 else None position_summary_text = position_details_list[1] if len(position_details_list) > 1 else None - outer_positions = position_summary_details.find_element_by_xpath("*").find_elements_by_xpath("*") + outer_positions = position_summary_details.find_element(By.XPATH,"*").find_elements(By.XPATH,"*") if len(outer_positions) == 4: - position_title = outer_positions[0].find_element_by_tag_name("span").find_element_by_tag_name("span").text - company = outer_positions[1].find_element_by_tag_name("span").text - work_times = outer_positions[2].find_element_by_tag_name("span").text - location = outer_positions[3].find_element_by_tag_name("span").text + position_title = outer_positions[0].find_element(By.TAG_NAME,"span").find_element(By.TAG_NAME,"span").text + company = outer_positions[1].find_element(By.TAG_NAME,"span").text + work_times = outer_positions[2].find_element(By.TAG_NAME,"span").text + location = outer_positions[3].find_element(By.TAG_NAME,"span").text elif len(outer_positions) == 3: if "·" in outer_positions[2].text: - position_title = outer_positions[0].find_element_by_tag_name("span").find_element_by_tag_name("span").text - company = outer_positions[1].find_element_by_tag_name("span").text - work_times = outer_positions[2].find_element_by_tag_name("span").text + position_title = outer_positions[0].find_element(By.TAG_NAME,"span").find_element(By.TAG_NAME,"span").text + company = outer_positions[1].find_element(By.TAG_NAME,"span").text + work_times = outer_positions[2].find_element(By.TAG_NAME,"span").text location = "" else: position_title = "" - company = outer_positions[0].find_element_by_tag_name("span").find_element_by_tag_name("span").text - work_times = outer_positions[1].find_element_by_tag_name("span").text - location = outer_positions[2].find_element_by_tag_name("span").text + company = outer_positions[0].find_element(By.TAG_NAME,"span").find_element(By.TAG_NAME,"span").text + work_times = outer_positions[1].find_element(By.TAG_NAME,"span").text + location = outer_positions[2].find_element(By.TAG_NAME,"span").text times = work_times.split("·")[0].strip() if work_times else "" duration = work_times.split("·")[1].strip() if len(work_times.split("·")) > 1 else None @@ -150,18 +148,18 @@ def get_experiences(self): from_date = " ".join(times.split(" ")[:2]) if times else "" to_date = " ".join(times.split(" ")[3:]) if times else "" - if position_summary_text and len(position_summary_text.find_element_by_class_name("pvs-list").find_element_by_class_name("pvs-list").find_elements_by_xpath("li")) > 1: - descriptions = position_summary_text.find_element_by_class_name("pvs-list").find_element_by_class_name("pvs-list").find_elements_by_xpath("li") + if position_summary_text and len(position_summary_text.find_element(By.CLASS_NAME,"pvs-list").find_element(By.CLASS_NAME,"pvs-list").find_elements(By.XPATH,"li")) > 1: + descriptions = position_summary_text.find_element(By.CLASS_NAME,"pvs-list").find_element(By.CLASS_NAME,"pvs-list").find_elements(By.XPATH,"li") for description in descriptions: - res = description.find_element_by_tag_name("a").find_elements_by_xpath("*") + res = description.find_element(By.TAG_NAME,"a").find_elements(By.XPATH,"*") position_title_elem = res[0] if len(res) > 0 else None work_times_elem = res[1] if len(res) > 1 else None location_elem = res[2] if len(res) > 2 else None - location = location_elem.find_element_by_xpath("*").text if location_elem else None - position_title = position_title_elem.find_element_by_xpath("*").find_element_by_tag_name("*").text if position_title_elem else "" - work_times = work_times_elem.find_element_by_xpath("*").text if work_times_elem else "" + location = location_elem.find_element(By.XPATH,"*").text if location_elem else None + position_title = position_title_elem.find_element(By.XPATH,"*").find_element(By.TAG_NAME,"*").text if position_title_elem else "" + work_times = work_times_elem.find_element(By.XPATH,"*").text if work_times_elem else "" times = work_times.split("·")[0].strip() if work_times else "" duration = work_times.split("·")[1].strip() if len(work_times.split("·")) > 1 else None from_date = " ".join(times.split(" ")[:2]) if times else "" @@ -201,23 +199,23 @@ def get_educations(self): self.scroll_to_half() 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_class_name("pvs-entity"): - institution_logo_elem, position_details = position.find_elements_by_xpath("*") + for position in main_list.find_elements(By.CLASS_NAME,"pvs-entity"): + institution_logo_elem, position_details = position.find_elements(By.XPATH,"*") # company elem - institution_linkedin_url = institution_logo_elem.find_element_by_xpath("*").get_attribute("href") + institution_linkedin_url = institution_logo_elem.find_element(By.XPATH,"*").get_attribute("href") # position details - position_details_list = position_details.find_elements_by_xpath("*") + position_details_list = position_details.find_elements(By.XPATH,"*") position_summary_details = position_details_list[0] if len(position_details_list) > 0 else None position_summary_text = position_details_list[1] if len(position_details_list) > 1 else None - outer_positions = position_summary_details.find_element_by_xpath("*").find_elements_by_xpath("*") + outer_positions = position_summary_details.find_element(By.XPATH,"*").find_elements(By.XPATH,"*") - institution_name = outer_positions[0].find_element_by_tag_name("span").find_element_by_tag_name("span").text - degree = outer_positions[1].find_element_by_tag_name("span").text + institution_name = outer_positions[0].find_element(By.TAG_NAME,"span").find_element(By.TAG_NAME,"span").text + degree = outer_positions[1].find_element(By.TAG_NAME,"span").text if len(outer_positions) > 2: - times = outer_positions[2].find_element_by_tag_name("span").text + times = outer_positions[2].find_element(By.TAG_NAME,"span").text from_date = " ".join(times.split(" ")[:2]) to_date = " ".join(times.split(" ")[3:]) @@ -240,14 +238,14 @@ 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_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 def get_about(self): try: - about = self.driver.find_element_by_id("about").find_element_by_xpath("..").find_element_by_class_name("display-flex").text + about = self.driver.find_element(By.ID,"about").find_element(By.XPATH,"..").find_element(By.CLASS_NAME,"display-flex").text except NoSuchElementException : about=None self.about = about diff --git a/samples/scrape_person.py b/samples/scrape_person.py index 7d4e93f..3dfcfa3 100644 --- a/samples/scrape_person.py +++ b/samples/scrape_person.py @@ -1,9 +1,21 @@ -import os -from linkedin_scraper import Person, actions from selenium import webdriver +import time +import sys + +# setting path +sys.path.append('../linkedin_scraper') +from linkedin_scraper import actions, Person + driver = webdriver.Chrome("./chromedriver") +time.sleep(2) +driver.maximize_window() +time.sleep(3) -email = os.getenv("LINKEDIN_USER") -password = os.getenv("LINKEDIN_PASSWORD") +email = "info@bargad.ai" +password = "Fizza123@" actions.login(driver, email, password) # if email and password isnt given, it'll prompt in terminal -person = Person("https://www.linkedin.com/in/andre-iguodala-65b48ab5", driver=driver) +time.sleep(2) + +person = Person("https://www.linkedin.com/in/swagatobag", driver=driver) + +print(vars(person)) From 878ce38ff110cf08d79cf2eef9b0f9f6d5bf867c Mon Sep 17 00:00:00 2001 From: Swagato Bag Date: Mon, 27 Mar 2023 00:19:01 +0530 Subject: [PATCH 2/7] Adding Functionalities Adding Functionalities like certifications, skills, projects, publications, recommendation, test scores, languages, volunteering, courses, awards sections --- linkedin_scraper/person.py | 161 ++++++++++++++++++++++++++++++++++--- 1 file changed, 149 insertions(+), 12 deletions(-) diff --git a/linkedin_scraper/person.py b/linkedin_scraper/person.py index b5e3f09..2717501 100644 --- a/linkedin_scraper/person.py +++ b/linkedin_scraper/person.py @@ -29,6 +29,17 @@ def __init__( scrape=True, close_on_complete=True, time_to_wait_after_login=0, + certifications=None, + skills=None, + projects=None, + test_scores=None, + languages=None, + volunteering=None, + recommendations=None, + publications=None, + courses=None, + awards=None, + ): self.linkedin_url = linkedin_url self.name = name @@ -39,6 +50,16 @@ def __init__( self.accomplishments = accomplishments or [] self.also_viewed_urls = [] self.contacts = contacts or [] + self.certifications = certifications or [] + self.skills = skills or [] + self.projects = projects or [] + self.test_scores = test_scores or [] + self.languages = languages or [] + self.volunteering = volunteering or [] + self.recommendations = recommendations or [] + self.publications = publications or [] + self.courses = courses or [] + self.awards = awards or [] if driver is None: try: @@ -82,6 +103,36 @@ def add_location(self, location): def add_contact(self, contact): self.contacts.append(contact) + def add_certifications(self, certification): + self.certifications.append(certification) + + def add_skills(self, skill): + self.skills.append(skill) + + def add_projects(self, project): + self.projects.append(project) + + def add_test_scores(self, test_score): + self.test_scores.append(test_score) + + def add_languages(self, language): + self.languages.append(language) + + def add_volunteering(self, volunteer): + self.volunteering.append(volunteer) + + def add_recommendations(self, recommendation): + self.recommendations.append(recommendation) + + def add_publications(self, publication): + self.publications.append(publication) + + def add_courses(self, course): + self.courses.append(course) + + def add_awards(self, award): + self.awards.append(award) + def scrape(self, close_on_complete=True): if self.is_signed_in(): self.scrape_logged_in(close_on_complete=close_on_complete) @@ -160,8 +211,8 @@ def get_experiences(self): location = location_elem.find_element(By.XPATH,"*").text if location_elem else None position_title = position_title_elem.find_element(By.XPATH,"*").find_element(By.TAG_NAME,"*").text if position_title_elem else "" work_times = work_times_elem.find_element(By.XPATH,"*").text if work_times_elem else "" - times = work_times.split("·")[0].strip() if work_times else "" - duration = work_times.split("·")[1].strip() if len(work_times.split("·")) > 1 else None + times = work_times.split("·")[0] if work_times else "" + duration = work_times.split("·")[1] if len(work_times.split("·")) > 1 else None from_date = " ".join(times.split(" ")[:2]) if times else "" to_date = " ".join(times.split(" ")[3:]) if times else "" @@ -171,7 +222,7 @@ def get_experiences(self): to_date=to_date, duration=duration, location=location, - description=description, + description=" ".join(description.split("\n")), institution_name=company, linkedin_url=company_linkedin_url ) @@ -185,7 +236,7 @@ def get_experiences(self): to_date=to_date, duration=duration, location=location, - description=description, + description=" ".join(description.split("\n")), institution_name=company, linkedin_url=company_linkedin_url ) @@ -242,7 +293,6 @@ def get_name_and_location(self): self.name = top_panels[0].find_elements(By.XPATH,"*")[0].text self.location = top_panels[1].find_element(By.TAG_NAME,"span").text - def get_about(self): try: about = self.driver.find_element(By.ID,"about").find_element(By.XPATH,"..").find_element(By.CLASS_NAME,"display-flex").text @@ -250,6 +300,36 @@ def get_about(self): about=None self.about = about + def get_certifications(self): + pass + + def get_skills(self): + pass + + def get_projects(self): + pass + + def get_test_scores(self): + pass + + def get_languages(self): + pass + + def get_volunteering(self): + pass + + def get_recommendations(self): + pass + + def get_publications(self): + pass + + def get_courses(self): + pass + + def get_awards(self): + pass + def scrape_logged_in(self, close_on_complete=True): driver = self.driver duration = None @@ -265,8 +345,32 @@ def scrape_logged_in(self, close_on_complete=True): self.focus() self.wait(5) - # get name and location - self.get_name_and_location() + # get experience + self.get_experiences() + + # get projects + self.get_projects() + + # get test scores + self.get_test_scores() + + # get languages + self.get_languages() + + # get volunteering + self.get_volunteering() + + # get recommendations + self.get_recommendations() + + # get publications + self.get_publications() + + # get courses + self.get_courses() + + # get awards + self.get_awards() self.open_to_work = self.is_open_to_work() @@ -279,11 +383,17 @@ def scrape_logged_in(self, close_on_complete=True): "window.scrollTo(0, Math.ceil(document.body.scrollHeight/1.5));" ) - # get experience - self.get_experiences() + # get certifications + self.get_certifications() + + # get skills + self.get_skills() + + # get certifications + self.get_certifications() - # get education - self.get_educations() + # get skills + self.get_skills() driver.get(self.linkedin_url) @@ -381,7 +491,24 @@ def job_title(self): return None def __repr__(self): - return "{name}\n\nAbout\n{about}\n\nExperience\n{exp}\n\nEducation\n{edu}\n\nInterest\n{int}\n\nAccomplishments\n{acc}\n\nContacts\n{conn}".format( + return """ + {name} + \n\nAbout\n{about} + \n\nExperience\n{exp} + \n\nEducation\n{edu} + \n\nInterest\n{int} + \n\nAccomplishments\n{acc} + \n\Certificates\n{cert} + \n\Skills\n{skill} + \n\Projects\n{proj} + \n\Test_Scores\n{scores} + \n\Languages\n{lang} + \n\Volunteering\n{voln} + \n\Recommendations\n{reco} + \n\Publications\n{pubs} + \n\Courses\n{course} + \n\Awards\n{award} + """.format( name=self.name, about=self.about, exp=self.experiences, @@ -389,4 +516,14 @@ def __repr__(self): int=self.interests, acc=self.accomplishments, conn=self.contacts, + cert=self.certifications, + skill=self.skills, + proj=self.projects, + scores=self.test_scores, + lang=self.languages, + voln=self.volunteering, + reco=self.recommendations, + pubs=self.publications, + course=self.courses, + award=self.awards, ) From 4e1d9cb80312c4653a993dcfaabbfc238413ca82 Mon Sep 17 00:00:00 2001 From: Andrew Ryder <1811535+andrewtryder@users.noreply.github.com> Date: Tue, 28 Mar 2023 17:00:31 -0400 Subject: [PATCH 3/7] Basic work on certifications. Add object and code. --- linkedin_scraper/actions.py | 2 +- linkedin_scraper/objects.py | 9 +++++++++ linkedin_scraper/person.py | 32 ++++++++++++++++++++++++++------ 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/linkedin_scraper/actions.py b/linkedin_scraper/actions.py index 136ffd1..dce2d0d 100644 --- a/linkedin_scraper/actions.py +++ b/linkedin_scraper/actions.py @@ -13,7 +13,7 @@ def page_has_loaded(driver): page_state = driver.execute_script('return document.readyState;') return page_state == 'complete' -def login(driver, email=None, password=None, cookie = None, timeout=10): +def login(driver, email=None, password=None, cookie = None, timeout=20): if cookie is not None: return _login_with_cookie(driver, cookie) diff --git a/linkedin_scraper/objects.py b/linkedin_scraper/objects.py index 747233c..0158bf5 100644 --- a/linkedin_scraper/objects.py +++ b/linkedin_scraper/objects.py @@ -47,6 +47,15 @@ class Education(Institution): degree: str = None +@dataclass +class Certification(Institution): + cert: str = None, + url: str = None, + issuing_body: str = None + issued_date: str = None + expires_date: str = None + + @dataclass class Interest(Institution): title = None diff --git a/linkedin_scraper/person.py b/linkedin_scraper/person.py index 2717501..ffab259 100644 --- a/linkedin_scraper/person.py +++ b/linkedin_scraper/person.py @@ -4,7 +4,7 @@ from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import NoSuchElementException -from .objects import Experience, Education, Scraper, Interest, Accomplishment, Contact +from .objects import Experience, Education, Scraper, Interest, Accomplishment, Contact, Certification import os class Person(Scraper): @@ -222,7 +222,7 @@ def get_experiences(self): to_date=to_date, duration=duration, location=location, - description=" ".join(description.split("\n")), + description=" ".join(description.text.split("\n")), institution_name=company, linkedin_url=company_linkedin_url ) @@ -301,7 +301,30 @@ def get_about(self): self.about = about def get_certifications(self): - pass + url = os.path.join(self.linkedin_url, "details/certifications") + self.driver.get(url) + self.focus() + main = self.wait_for_element_to_load(by=By.ID, name="main") + self.scroll_to_half() + self.scroll_to_bottom() + main_list = self.wait_for_element_to_load(name="pvs-list", base=main) + for (i, certification) in enumerate(main_list.find_elements(By.XPATH, '//div[@class="display-flex flex-column full-width align-self-center"]')): + cert_tags = certification.find_elements(By.TAG_NAME, "span") + # we might want to check the length here. + certification_name = cert_tags[1].text + certification_body = cert_tags[4].text + certification_issued = cert_tags[7].text + certification_expires = None + certification_url = certification.find_element(By.XPATH, "*").get_attribute("href") + + certification = Certification( + cert = certification_name, + url = certification_url, + issuing_body = certification_body, + expires_date = certification_expires + ) + + self.add_certifications(certification) def get_skills(self): pass @@ -389,9 +412,6 @@ def scrape_logged_in(self, close_on_complete=True): # get skills self.get_skills() - # get certifications - self.get_certifications() - # get skills self.get_skills() From 8050198b5e82db91c4ace24f821fc48c0090516d Mon Sep 17 00:00:00 2001 From: Andrew Ryder <1811535+andrewtryder@users.noreply.github.com> Date: Tue, 28 Mar 2023 17:12:42 -0400 Subject: [PATCH 4/7] Split the 10 - 20 difference at 15 for timeout. --- linkedin_scraper/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linkedin_scraper/actions.py b/linkedin_scraper/actions.py index dce2d0d..90ed174 100644 --- a/linkedin_scraper/actions.py +++ b/linkedin_scraper/actions.py @@ -13,7 +13,7 @@ def page_has_loaded(driver): page_state = driver.execute_script('return document.readyState;') return page_state == 'complete' -def login(driver, email=None, password=None, cookie = None, timeout=20): +def login(driver, email=None, password=None, cookie = None, timeout=15): if cookie is not None: return _login_with_cookie(driver, cookie) From 8565ae19679ab01f6d02e70116dbd0a1b642d695 Mon Sep 17 00:00:00 2001 From: Andrew Ryder <1811535+andrewtryder@users.noreply.github.com> Date: Wed, 29 Mar 2023 10:33:51 -0400 Subject: [PATCH 5/7] Update get_experiences to adapt for outer_positions as 2 --- linkedin_scraper/person.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linkedin_scraper/person.py b/linkedin_scraper/person.py index ffab259..4a8212d 100644 --- a/linkedin_scraper/person.py +++ b/linkedin_scraper/person.py @@ -192,6 +192,9 @@ def get_experiences(self): company = outer_positions[0].find_element(By.TAG_NAME,"span").find_element(By.TAG_NAME,"span").text work_times = outer_positions[1].find_element(By.TAG_NAME,"span").text location = outer_positions[2].find_element(By.TAG_NAME,"span").text + elif len(outer_positions) == 2: + company = outer_positions[0].find_element(By.TAG_NAME,"span").find_element(By.TAG_NAME,"span").text + work_times = outer_positions[1].find_element(By.TAG_NAME,"span").text times = work_times.split("·")[0].strip() if work_times else "" duration = work_times.split("·")[1].strip() if len(work_times.split("·")) > 1 else None @@ -206,8 +209,6 @@ def get_experiences(self): position_title_elem = res[0] if len(res) > 0 else None work_times_elem = res[1] if len(res) > 1 else None location_elem = res[2] if len(res) > 2 else None - - location = location_elem.find_element(By.XPATH,"*").text if location_elem else None position_title = position_title_elem.find_element(By.XPATH,"*").find_element(By.TAG_NAME,"*").text if position_title_elem else "" work_times = work_times_elem.find_element(By.XPATH,"*").text if work_times_elem else "" From 1ce0d0f53b75fa9f4800ad7a80adec2304dd0884 Mon Sep 17 00:00:00 2001 From: Andrew Ryder <1811535+andrewtryder@users.noreply.github.com> Date: Wed, 29 Mar 2023 11:05:52 -0400 Subject: [PATCH 6/7] Delete scrape_person.py Not needed. --- samples/scrape_person.py | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 samples/scrape_person.py diff --git a/samples/scrape_person.py b/samples/scrape_person.py deleted file mode 100644 index 3dfcfa3..0000000 --- a/samples/scrape_person.py +++ /dev/null @@ -1,21 +0,0 @@ -from selenium import webdriver -import time -import sys - -# setting path -sys.path.append('../linkedin_scraper') -from linkedin_scraper import actions, Person - -driver = webdriver.Chrome("./chromedriver") -time.sleep(2) -driver.maximize_window() -time.sleep(3) - -email = "info@bargad.ai" -password = "Fizza123@" -actions.login(driver, email, password) # if email and password isnt given, it'll prompt in terminal -time.sleep(2) - -person = Person("https://www.linkedin.com/in/swagatobag", driver=driver) - -print(vars(person)) From 27eb4f674afded8d4dca22f24f25f1e619cb46b3 Mon Sep 17 00:00:00 2001 From: Andrew Ryder <1811535+andrewtryder@users.noreply.github.com> Date: Wed, 29 Mar 2023 15:03:02 -0400 Subject: [PATCH 7/7] Delete file locally. --- samples/scrape_person.py | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 samples/scrape_person.py diff --git a/samples/scrape_person.py b/samples/scrape_person.py deleted file mode 100644 index 3dfcfa3..0000000 --- a/samples/scrape_person.py +++ /dev/null @@ -1,21 +0,0 @@ -from selenium import webdriver -import time -import sys - -# setting path -sys.path.append('../linkedin_scraper') -from linkedin_scraper import actions, Person - -driver = webdriver.Chrome("./chromedriver") -time.sleep(2) -driver.maximize_window() -time.sleep(3) - -email = "info@bargad.ai" -password = "Fizza123@" -actions.login(driver, email, password) # if email and password isnt given, it'll prompt in terminal -time.sleep(2) - -person = Person("https://www.linkedin.com/in/swagatobag", driver=driver) - -print(vars(person))