mercredi 28 avril 2021

Returning Empty list while getting text from span tag (Web scrapping)

import requests
from bs4 import BeautifulSoup

headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'}

html_text=requests.get('https://www.daraz.com.np/televisions/?spm=a2a0e.11779170.cate_3.1.287d2d2bmERvcc',headers=headers).content

soup=BeautifulSoup(html_text, 'lxml')
#soup = BeautifulSoup(html_text, 'html5lib')

string1=soup.find('span',class_='c13VH6')
print(soup.find('span', class_='c13VH6'))
print(string1)

its printing none value.




Aucun commentaire:

Enregistrer un commentaire