Python - ImportError: cannot import name "BeatifulSoup4" from "bs4"

 
Vista:
sin imagen de perfil

ImportError: cannot import name "BeatifulSoup4" from "bs4"

Publicado por CRISTIAN OMAR (4 intervenciones) el 24/03/2021 16:38:43
1
2
3
4
5
6
7
8
9
10
11
12
13
#Windows 10 64 bits, python v. 3.9.0
#pip install requests
#pip install bs4, pip install beautifulsoup4
 
import requests
from bs4 import BeatifulSoup4 as bs
 
github_user = input('Ingresa tu usario GitHub: ')
url = 'https://github.com/'+github_user
r = requests.get(url)
soup = bs(r.content, 'html.parser')
profile_image = soup.find('img', {'alt' : 'Avatar'})['src']
print(profile_image)
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

ImportError: cannot import name "BeatifulSoup4" from "bs4"

Publicado por CRISTIAN OMAR (4 intervenciones) el 24/03/2021 17:30:17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#RESUELTO!, ERROR DE ESCRITURA
 
#pip install requests
#pip install bs4, pip install beautifulsoup4
 
import requests
from bs4 import BeautifulSoup
 
github_user = input('Ingresa tu usario GitHub: ')
url = 'https://github.com/'+github_user
r = requests.get(url)
soup = BeautifulSoup(r.content, 'html.parser')
profile_image = soup.find('img', {'alt' : 'Avatar'})['src']
print(profile_image)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar