from bs4 import BeautifulSoup
import requests
import time
import datetime
import smtplib
URL = 'https://www.myntra.com/casual-shoes/highlander/highlander-men-white-sneakers/11097156/buy'
page = requests.get(URL, headers=headers)
soup1 = BeautifulSoup(page.content, "html.parser")
soup2 = BeautifulSoup(soup1.prettify(), "html.parser")
title = soup2.find(id='pdp-name').get_text()
price = soup2.find(id='pdp-price').get_text()
print(title)
print(price)
output:- AttributeError: 'NoneType' object has no attribute 'get_text'