derrick
LinkedIn Scraping 3 min read

LinkedIn Scraping

LinkedIn Scraping with Python in 2026: 4 Approaches Compared (Native Script, Open-Source Libs, Public API, MCP)

Should you write your own LinkedIn scraper in Python? The 4 approaches with their tradeoffs - when DIY is worth it, when it's a trap.

Updated 3 min read

You want to scrape LinkedIn data from Python. Logical: Python has the libraries, you have the dev skills, why pay for a tool? Reality check: writing your own LinkedIn scraper in 2026 is a maintenance burden that costs more than most paid tools - unless your use case is very specific.

Here are the 4 approaches that actually exist in 2026, with their real-world tradeoffs.

Approach 1: Native Python script (requests + BeautifulSoup)

The DIY classic. You authenticate via cookie, send GET requests, parse HTML.

Pros: zero cost, full control, learn the structure of LinkedIn pages.

Cons:

  • LinkedIn changes its HTML structure every 2-3 months - your selectors break constantly
  • You need to rotate cookies, manage proxies if you want any volume
  • Anti-bot detection: too many requests from one IP = your account is flagged
  • Maintenance cost: ~5-10h/month minimum once you're past the prototype

When it works: one-shot extraction of <100 profiles for research. Stop there.

Approach 2: Open-source libraries (linkedin-scraper, etc.)

GitHub libs like linkedin-scraper, linkedin-api, linkedin-jobs-api wrap the messy parts.

Pros: faster setup, community-maintained selectors, examples for common workflows.

Cons:

  • Most are unmaintained - last commit 8-12 months ago means they're already broken
  • Still cookie-bound: you risk your account
  • No anti-detection layer - same IP issues as native script
  • License risk: some libs violate LinkedIn ToS explicitly

When it works: small-team prototyping where you can stomach breakage every 2-3 months and don't mind babysitting.

Approach 3: Public LinkedIn API (Marketing / Talent / Sales Navigator)

LinkedIn has 3 official APIs. None of them give you full profile scraping.

  • Marketing API: ads management, audience insights. Not for profile data.
  • Talent API: job postings, applicant data. Restricted to LinkedIn Talent customers.
  • Sales Navigator API: limited list export. Requires Sales Nav Advanced Plus.

Pros: compliant, your account is safe, structured JSON output.

Cons:

  • Coverage is intentionally limited (LinkedIn doesn't want you to scrape)
  • Approval process for production access is slow (weeks)
  • You don't get individual profile data via any of these APIs

When it works: if you're in Talent Solutions, building on top of LinkedIn data with their blessing.

Approach 4: MCP server wrapper (modern, conversational)

MCP (Model Context Protocol) servers expose LinkedIn data through a standardized interface that Claude and other LLMs can call directly. The Python side is just calling the MCP server, not writing scraping logic yourself.

Pros:

  • Zero scraping code to maintain - the MCP server handles it
  • Conversational interface: "Get me the headcount of TechCorp" instead of writing a function
  • Native fit with AI workflows

Cons:

  • Newer ecosystem - fewer mature MCP servers as of 2026
  • You're dependent on the MCP server's coverage and reliability
  • Not all data sources have an MCP yet

When it works: AI-native workflows where the LinkedIn data feeds into Claude/GPT for analysis or generation.

Decision matrix: which approach for which use case

Use caseRecommended approachWhy
One-shot research (<100 profiles)Native scriptFastest setup, throwaway code is fine
Recurring extraction 200-2k/moOpen-source lib + babysitManageable maintenance at this volume
Production app needing LinkedIn dataPublic API or paid serviceCompliance + reliability matter
AI workflow / agentic useMCP serverConversational interface fits LLM stack
Bulk sales prospectingPaid tool (not Python)The maintenance cost of DIY exceeds tool price

Key takeaways

  • Writing your own Python LinkedIn scraper is rarely worth it in 2026 - the maintenance cost outpaces paid tools at most volumes.
  • Native scripts and open-source libs both depend on stable cookies and IPs you don't have access to at scale.
  • Official LinkedIn APIs don't give you profile data - they're aimed at advertising and recruiting workflows.
  • MCP servers are the modern alternative if you're building an AI workflow; they remove scraping from your code path entirely.
  • Decision rule: if your use case is sales prospecting, use a paid tool. If it's research or AI integration, pick from the 4 approaches above based on the matrix.

Frequently asked questions

Scraper LinkedIn en Python est-il légal en France ?


Le scraping de données publiques sans login est défendable, mais viole les CGU de LinkedIn. Le traitement RGPD reste obligatoire dès que vous stockez des données personnelles européennes. L'arrêt hiQ Labs ne s'applique pas en droit européen.

Quelle est la meilleure bibliothèque Python pour scraper LinkedIn ?


linkedin-api de tomquirk pour la rapidité de mise en place (cookie de session, pas de Selenium). linkedin-scraper de joeyism pour une approche plus robuste basée sur Selenium. Les deux nécessitent un compte personnel.

Peut-on scraper LinkedIn sans utiliser son compte ?


Oui via l'endpoint jobs-guest (offres d'emploi uniquement) ou via une API tierce comme Derrick qui fait l'extraction côté serveur. Aucune des deux options n'utilise vos identifiants LinkedIn.

Quel volume mon script peut-il atteindre avant un blocage ?


Sans login : ~50 requêtes/h depuis une IP. Avec un cookie de session : 100–500 profils/jour selon la fraîcheur du cookie. Avec une API native : selon votre plan, généralement plusieurs milliers/jour.

BeautifulSoup ou Selenium pour scraper LinkedIn ?


BeautifulSoup suffit pour le HTML statique des pages publiques. Selenium est nécessaire dès que la donnée est rendue par JavaScript ou requiert un login. Pour un workflow Python natif sans navigateur, linkedin-api (cookie de session) est plus léger que Selenium.

Start enriching your sheet in 30 seconds

Free for 100 credits/month. No credit card.

Install Derrick free →