Generation

generate functionWed, 08 Feb 2023

go to linkedin and scrape contact information contact name job title employment timeline company name employee size number of employees at company

import requests from bs4 import BeautifulSoup def scrape_linkedin(url): contact_name, job_title, employment_timeline, company_name, employee_size, number_of_employees_at_company = '', '', '', '', '', '' r = requests.get(url, headers={'User-Agent': 'Mozilla/5.0'}) soup = BeautifulSoup(r.content, 'html.parser') contact_name = soup.select('.pv-top-card-section__name')[0].text.strip() job_title = soup.select('.pv-top-card-section__headline')[0].text.strip() employment_timeline = soup.select('.pv-entity__secondary-title')[0].text.strip() company_name = soup.select('.pv-entity__secondary-title')[1].text.strip() employee_size = soup.select('.pv-entity__bullet-item-v2')[

Questions about programming?Chat with your personal AI assistant