How can I get the data from the following tag:
<a class="sc-bdVaJa ebNrSm" href="/inmueble/venta-apartamento-bogota-puente-largo-2-habitaciones-2-banos-2-garajes/14221-M3963321" target="_blank" data-gtm-productname="Apartamento en Venta, Puente Largo, Bogotá D.C." data-gtm-productsku="14221-M3963321" data-gtm-productprice="457000000" data-gtm-productcategory="venta - Apartamento" data-gtm-city="Bogotá D.C." data-gtm-zone="Noroccidente" data-gtm-neighborhood="PUENTE LARGO" data-gtm-businesstype="venta" data-gtm-propertytype="Apartamento" data-gtm-projectname="Ocasional" data-gtm-position="1"\><h2 class="sc-dxgOiQ BSoGx card-title"\><div\>Apartamento en Venta, Puente Largo, Bogotá D.C.</div\></h2\></a\>
i try:
import requests
from bs4 import BeautifulSoup
url = 'https://www.metrocuadrado.com/apartamento/venta/bogota/?search=form'
page = requests.get(url)
soup = BeautifulSoup(page.content, 'lxml')
projects = soup.find('a', class_='sc-bdVaJa ebNrSm')
print(projects.text)
but, i get error: AttributeError: 'NoneType' object has no attribute 'text'