Hello I am new to web scrapping. I am trying to get price and name of the product from the given url(https://www.daraz.com.np/televisions/?spm=a2a0e.11779170.cate_3.1.287d2d2bmERvcc).
When i inspect the element the price of the product is in span tag with class name 'c13VH6'.
I am getting empty string only. Below is my code.
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).text soup=BeautifulSoup(html_text, 'lxml') #soup = BeautifulSoup(html_text, 'html5lib') string1=soup.find('span',class_='c13VH6') print(soup.find('span', class_='c13VH6')) print(string1)
https://stackoverflow.com/questions/67310293/returning-empty-list-while-getting-text-from-span-tag-web-scrapping April 29, 2021 at 10:36AM
没有评论:
发表评论