I am trying to scrape few values from LI page, I could get name, education, headline. I added code for profile picture, summary but could not get it.
Any helping hints much appreciate.
def getLinkedinData(self):
result = {}
driver = webdriver.PhantomJS('/usr/local/bin/phantomjs' ,service_args=service_args)
driver.set_window_size(1124, 850)
google_news_trends = []
driver.get("https://www.linkedin.com/in/joymerrillsti")
driver.page_source.encode("utf-8")
try:
print driver.find_element_by_class_name('full-name').text#
except:
pass
#This does not give link to profile picture
try:
img = driver.find_element_by_class_name('profile-picture')
for s in img:
print s
print s.find_element_by_tag_name('img').get_attribute('src')
except:
pass
try:
head = driver.find_element_by_id('headline-container')
print head.text
for s in head:
print s.find_element_by_tag_name('p').text
except:
pass
try:
location = driver.find_element_by_id('location-container')
for s in location:
print s.find_element_by_tag_name('a').text
except:
pass
#This does not give summary
try:
summary = driver.find_element_by_id('summary-item')
for s in summary:
print s.text
print s.find_element_by_tag_name('p').text
except:
pass
#This is fine, but is there any way to get only value for Education
try:
ed = driver.find_element_by_id('overview-summary-education') #Here how to get only education value?
print ed.text
except:
pass