
Python 3-Skript zum Dumpen/Scrapen/Extrahieren von Unternehmensmitarbeitern aus der LinkedIn-API
LinkedInDumper ist ein Python 3-Skript, das Mitarbeiterdaten von der sozialen Netzwerkplattform LinkedIn ausliest.
Die Ergebnisse enthalten Vorname, Nachname, Position (Titel), Standort und einen Profil-Link des Benutzers. Es sind nur 2 API-Aufrufe erforderlich, um alle Mitarbeiter abzurufen, wenn das Unternehmen nicht mehr als 10 Mitarbeiter hat. Andernfalls müssen wir durch die API-Ergebnisse paginieren. Mit dem CLI-Flag --email-format kann ein Python-String-Format definiert werden, um E-Mail-Adressen basierend auf dem abgerufenen Vor- und Nachnamen automatisch zu generieren.
LinkedInDumper kommuniziert mit der inoffiziellen LinkedIn Voyager API, die eine Authentifizierung erfordert. Daher benötigst du einen gültigen LinkedIn-Benutzeraccount. Der Einfachheit halber erwartet LinkedInDumper lediglich einen von dir bereitgestellten Cookie-Wert. Auf diese Weise werden sogar durch 2FA geschützte Accounts unterstützt. Darüber hinaus musst du eine LinkedIn-Unternehmens-URL angeben, von der die Mitarbeiter gedumpt werden sollen.
li_at-Session-Cookie-Wert ab, z. B. über die Entwicklertools.li_at oder temporär während der Laufzeit über das CLI-Flag --cookie an.usage: linkedindumper.py [-h] --url <linkedin-url> [--cookie <cookie>] [--quiet] [--include-private-profiles] [--include-contact-infos] [--jitter] [--email-format <mail-format>] [--output-json <json-file>] [--output-csv <csv-file>]
options:
-h, --help show this help message and exit
--url <linkedin-url> A LinkedIn company url - https://www.linkedin.com/company/<company>
--cookie <cookie> LinkedIn 'li_at' session cookie
--include-private-profiles
Show private accounts too
--include-contact-infos
Query each employee individually and retrieve contact infos
--jitter Add a random jitter to HTTP requests to bypass rate limiting
--email-format <mail-format>
Python string format for emails; for example:
--email-format '{0}.{1}@example.com' --> [email protected]
--email-format '{0[0]}.{1}@example.com' --> [email protected]
--email-format '{1}@example.com' --> [email protected]
--email-format '{0}@example.com' --> [email protected]
--email-format '{0[0]}{1[0]}@example.com' --> [email protected]
--output-json <json-file>
Store results in json output file
--output-csv <csv-file>
Store results in csv output file
docker run --rm l4rm4nd/linkedindumper:latest --url 'https://www.linkedin.com/company/apple' --cookie '<cookie>' --email-format '{0}.{1}@apple.de'
# install dependencies
pip install -r requirements.txt
python3 linkedindumper.py --url 'https://www.linkedin.com/company/apple' --cookie '<cookie>' --email-format '{0}.{1}@apple.de'
Das Skript gibt die Mitarbeiterdaten als semikolongetrennte Werte (wie CSV) zurück:
██▓ ██▓ ███▄ █ ██ ▄█▀▓█████ ▓█████▄ ██▓ ███▄ █ ▓█████▄ █ ██ ███▄ ▄███▓ ██▓███ ▓█████ ██▀███
▓██▒ ▓██▒ ██ ▀█ █ ██▄█▒ ▓█ ▀ ▒██▀ ██▌▓██▒ ██ ▀█ █ ▒██▀ ██▌ ██ ▓██▒▓██▒▀█▀ ██▒▓██░ ██▒▓█ ▀ ▓██ ▒ ██▒
▒██░ ▒██▒▓██ ▀█ ██▒▓███▄░ ▒███ ░██ █▌▒██▒▓██ ▀█ ██▒░██ █▌▓██ ▒██░▓██ ▓██░▓██░ ██▓▒▒███ ▓██ ░▄█ ▒
▒██░ ░██░▓██▒ ▐▌██▒▓██ █▄ ▒▓█ ▄ ░▓█▄ ▌░██░▓██▒ ▐▌██▒░▓█▄ ▌▓▓█ ░██░▒██ ▒██ ▒██▄█▓▒ ▒▒▓█ ▄ ▒██▀▀█▄
░██████▒░██░▒██░ ▓██░▒██▒ █▄░▒████▒░▒████▓ ░██░▒██░ ▓██░░▒████▓ ▒▒█████▓ ▒██▒ ░██▒▒██▒ ░ ░░▒████▒░██▓ ▒██▒
░ ▒░▓ ░░▓ ░ ▒░ ▒ ▒ ▒ ▒▒ ▓▒░░ ▒░ ░ ▒▒▓ ▒ ░▓ ░ ▒░ ▒ ▒ ▒▒▓ ▒ ░▒▓▒ ▒ ▒ ░ ▒░ ░ ░▒▓▒░ ░ ░░░ ▒░ ░░ ▒▓ ░▒▓░
░ ░ ▒ ░ ▒ ░░ ░░ ░ ▒░░ ░▒ ▒░ ░ ░ ░ ░ ▒ ▒ ▒ ░░ ░░ ░ ▒░ ░ ▒ ▒ ░░▒░ ░ ░ ░ ░ ░░▒ ░ ░ ░ ░ ░▒ ░ ▒░
░ ░ ▒ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░░░ ░ ░ ░ ░ ░░ ░ ░░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░ ░ by LRVT
[i] Company Name: apple
[i] Company X-ID: 162479
[i] LN Employees: 1000 employees found
[i] Dumping Date: 17/10/2022 13:55:06
[i] Email Format: {0}.{1}@apple.de
Firstname;Lastname;Email;Position;Gender;Location;Profile
Katrin;Honauer;[email protected];Software Engineer at Apple;N/A;Heidelberg;https://www.linkedin.com/in/katrin-honauer
Raymond;Chen;[email protected];Recruiting at Apple;N/A;Austin, Texas Metropolitan Area;https://www.linkedin.com/in/raytherecruiter
[i] Successfully crawled 2 unique apple employee(s). Hurray ^_-
Optional kannst du die CLI-Parameter --output-json und --output-csv verwenden, um die Ergebnisse als JSON oder CSV zu speichern.