""" 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.kickto.net/' + 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.kickto.net' + img_perfil print(resp)