Skip to content

Python 3 script to dump/scrape/extract company employees from XING API

Notifications You must be signed in to change notification settings

l4rm4nd/XingDumper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XingDumper

Python 3 script to dump company employees from XING API





Buy Me A Coffee

💬 Description

XingDumper is a Python 3 script that dumps employee data from the XING social networking platform.

The results contain firstname, lastname, position, gender, location and a user's profile link. Only 2 API calls are required to retrieve all employees. With the --email-format CLI flag one can define a Python string format to auto generate email addresses based on the retrieved first and last name.

✨ Requirements

XingDumper talks with the unofficial XING API, which requires authentication. Therefore, you must have a valid XING user account. To keep it simple, XingDumper just expects a cookie value provided by you. Doing it this way, even 2FA protected accounts are supported. Furthermore, you are tasked to provide a XING company URL to dump employees from.

Retrieving XING Cookie

  1. Sign into www.xing.com and retrieve your login cookie value e.g. via developer tools
  2. Specify your cookie value either in the python script's variable LOGIN_COOKIE or temporarily during runtime via the CLI flag --cookie

Retrieving XING Company URL

  1. Search your target company on Google Search or directly on XING
  2. The Xing company URL should look something like this: https://www.xing.com/pages/appleretaildeutschlandgmbh

🎓 Usage

usage: xingdumper.py [-h] --url <xing-url> [--count <number>] [--cookie <cookie>] [--full] [--quiet] [--email-format EMAIL_FORMAT]

options:
  -h, --help            show this help message and exit
  --url <xing-url>      A XING company url - https://xing.com/pages/<company>
  --count <number>      Amount of employees to extract - max. 2999
  --cookie <cookie>     XING 'login' cookie for authentication
  --full                Dump additional contact details (slow) - email, phone, fax, mobile
  --quiet               Show employee results only
  --email-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]

🐳 Example 1 - Docker Run

docker run --rm l4rm4nd/xingdumper:latest --url https://www.xing.com/pages/audiag --cookie '<cookie>' --email-format '{0}.{1}@apple.de'

🐍 Example 2 - Native Python

# install dependencies
pip install -r requirements.txt

python3 xingdumper.py --url https://www.xing.com/pages/audiag --cookie '<cookie>' --email-format '{0}.{1}@apple.de'

💎 Outputs

The script will return employee data as semi-colon separated values (like CSV):


▒██   ██▒ ██▓ ███▄    █   ▄████ ▓█████▄  █    ██  ███▄ ▄███▓ ██▓███  ▓█████  ██▀███  
▒▒ █ █ ▒░▓██▒ ██ ▀█   █  ██▒ ▀█▒▒██▀ ██▌ ██  ▓██▒▓██▒▀█▀ ██▒▓██░  ██▒▓█   ▀ ▓██ ▒ ██▒
░░  █   ░▒██▒▓██  ▀█ ██▒▒██░▄▄▄░░██   █▌▓██  ▒██░▓██    ▓██░▓██░ ██▓▒▒███   ▓██ ░▄█ ▒
 ░ █ █ ▒ ░██░▓██▒  ▐▌██▒░▓█  ██▓░▓█▄   ▌▓▓█  ░██░▒██    ▒██ ▒██▄█▓▒ ▒▒▓█  ▄ ▒██▀▀█▄  
▒██▒ ▒██▒░██░▒██░   ▓██░░▒▓███▀▒░▒████▓ ▒▒█████▓ ▒██▒   ░██▒▒██▒ ░  ░░▒████▒░██▓ ▒██▒
▒▒ ░ ░▓ ░░▓  ░ ▒░   ▒ ▒  ░▒   ▒  ▒▒▓  ▒ ░▒▓▒ ▒ ▒ ░ ▒░   ░  ░▒▓▒░ ░  ░░░ ▒░ ░░ ▒▓ ░▒▓░
░░   ░▒ ░ ▒ ░░ ░░   ░ ▒░  ░   ░  ░ ▒  ▒ ░░▒░ ░ ░ ░  ░      ░░▒ ░      ░ ░  ░  ░▒ ░ ▒░
 ░    ░   ▒ ░   ░   ░ ░ ░ ░   ░  ░ ░  ░  ░░░ ░ ░ ░      ░   ░░          ░     ░░   ░ 
 ░    ░   ░           ░       ░    ░       ░            ░               ░  ░  by LRVT                                                   

[i] Company Name: Apple
[i] Company X-ID: 271572.8873b4
[i] Company Slug: appleretaildeutschlandgmbh
[i] Dumping Date: 24/12/2021 13:37:00
[i] Email Format: {0}.{1}@apple.de

Firstname;Lastname;Email;Position;Gender;Location;E-Mail;Fax;Mobile;Phone;Profile
Mina;Abdallah;[email protected];RFIC Design Engineer;MALE;Unterhaching,Deutschland;None;None;None;None;https://www.xing.com/profile/Mina_Abdallah
Isma;Abdan;[email protected];Gabelstaplerfahrer;MALE;Huelva,Spanien;None;None;None;None;https://www.xing.com/profile/Isma_Abdan

[i] Successfully crawled 2 Apple employees. Hurray ^_-

💥 Limitations

Dumped contact details via --full are most often empty. Germans seem to take privacy very seriously.

Furthermore, the details may only be accessible if you already belong to the contact list of the crawled employee. Kinda unlikely, however, the default privacy settings of XING would allow a retrival, if the data is configured and the privacy settings not changed by the crawled employee.

🤖 Repo Statistics

Alt