26 lines
618 B
Python
26 lines
618 B
Python
"""
|
|
Git-hub, Gitea user image profile scrapper
|
|
"""
|
|
|
|
import requests
|
|
from bs4 import BeautifulSoup as bs
|
|
|
|
# Nombre usario
|
|
git_usr = input('Ingresa un nombre de usuario: ')
|
|
|
|
# Sitio
|
|
url = 'https://github.com/' + git_usr
|
|
#url = 'https://gitea.letz.dev/' + git_usr
|
|
|
|
# Request
|
|
r = requests.get(url)
|
|
|
|
# Obtención del link con BeautifulSoup
|
|
soup = bs(r.content, 'html.parser')
|
|
img_perfil = soup.find('img', {'class' : 'avatar avatar-user width-full border color-bg-primary'})['src']
|
|
#img_perfil = soup.find('img', {'class' : 'avatar'})['src']
|
|
|
|
resp = img_perfil
|
|
#resp = 'https://gitea.letz.dev' + img_perfil
|
|
print(resp)
|