empy list when using find all by class name

Viewed 10

I want to scrap the selected line to use the .text attribute on it. However, when I use findAll(), the function returns an empty list. Does someone see the problem in my code?

import time
import requests
from bs4 import BeautifulSoup

link = 'https://www.vivanuncios.com.mx/a-casas-en-venta/virreyes/casa-con-vista-panaromica-a-canada-a-8-mnts-de-andares/1003826809920911161360109'
page = requests.get(link)
time.sleep(5)
soup = BeautifulSoup(page.text, 'html.parser')
            
div1 = soup.findAll('div',{'class': 'location-name'})
for i in div1:
    print(i.text)

enter image description here

0 Answers
Related