Skip to content

Commit

Permalink
Fixed bug with cached values
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyism committed Mar 9, 2021
1 parent 9c0ca53 commit e988acf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion linkedin_scraper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .objects import Institution, Experience, Education, Contact
from .company import Company

__version__ = "2.7.4"
__version__ = "2.7.5"

import glob
modules = glob.glob(dirname(__file__)+"/*.py")
Expand Down
30 changes: 13 additions & 17 deletions linkedin_scraper/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ def __init__(
self,
linkedin_url=None,
name=None,
about=[],
experiences=[],
educations=[],
interests=[],
accomplishments=[],
about=None,
experiences=None,
educations=None,
interests=None,
accomplishments=None,
company=None,
job_title=None,
contacts=[],
contacts=None,
driver=None,
get=True,
scrape=True,
close_on_complete=True,
):
self.linkedin_url = linkedin_url
self.name = name
self.about = about
self.experiences = experiences
self.educations = educations
self.interests = interests
self.accomplishments = accomplishments
self.about = about or []
self.experiences = experiences or []
self.educations = educations or []
self.interests = interests or []
self.accomplishments = accomplishments or []
self.also_viewed_urls = []
self.contacts = contacts
self.contacts = contacts or []

if driver is None:
try:
Expand Down Expand Up @@ -81,7 +81,6 @@ def add_contact(self, contact):
self.contacts.append(contact)

def scrape(self, close_on_complete=True):

if self.is_signed_in():
self.scrape_logged_in(close_on_complete=close_on_complete)
else:
Expand All @@ -104,9 +103,7 @@ def scrape_logged_in(self, close_on_complete=True):
duration = None

root = driver.find_element_by_class_name(self.__TOP_CARD)
self.name = root.find_elements_by_xpath("//section/div/div/div/*/li")[
0
].text.strip()
self.name = root.find_elements_by_xpath("//section/div/div/div/*/li")[0].text.strip()

# get about
try:
Expand Down Expand Up @@ -329,7 +326,6 @@ def scrape_not_logged_in(self, close_on_complete=True, retry_limit=10):
exp = driver.find_element_by_class_name("experience")
except:
exp = None
import ipdb; ipdb.set_trace()

if exp is not None:
for position in exp.find_elements_by_class_name(
Expand Down

0 comments on commit e988acf

Please sign in to comment.