Skip to content

Instantly share code, notes, and snippets.

@sdcampbell
Created January 2, 2019 13:02
Show Gist options
  • Save sdcampbell/f5c45bc889ece0096c6734f1f2904164 to your computer and use it in GitHub Desktop.
Save sdcampbell/f5c45bc889ece0096c6734f1f2904164 to your computer and use it in GitHub Desktop.
Ptrace Python for Ethical Hackers LinkedIn Profile Picture Downloader
#!/usr/bin/env python3
"""LinkedIn-Profile-Pic-Downloader.py - download LinkedIn profile picture"""
__author__ = "Steven Campbell (@lpha3ch0)"
__copyright__ = "Copyright 2018, Steven Campbell"
__credits__ = ["Steven Campbell"]
__license__ = "GPL"
__version__ = "1.0"
__maintainer__ = "Steven Campbell"
__email__ = "sdcampbell68@live.com"
__status__ = "Prototype"
import requests
from bs4 import BeautifulSoup
def main():
client = requests.Session()
HOMEPAGE_URL = 'https://www.linkedin.com'
LOGIN_URL = 'https://www.linkedin.com/uas/login-submit'
html = client.get(HOMEPAGE_URL).text
soup = BeautifulSoup(html)
csrf = soup.find(id="loginCsrfParam-login")['value']
login_information = {
'session_key': "username",
'session_password': "password",
'loginCsrfParam-login': csrf,
}
client.post(LOGIN_URL, data=login_information)
html = client.get('https://www.linkedin.com/in/hack-the-planet/').text
soup = BeautifulSoup(html)
profile_img = soup.find("img", class_="profile-photo-edit__preview xh-highlight")
if __name__ == "__main__":
main()
@melquelima
Copy link

it is not working unfortunatelly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment