0

New to web crawling :) I want the list of mobile phones from flipkart. The url I am using is https://www.flipkart.com/mobiles/pr?sid=tyy,4io&otracker=categorytree

The only div i want to pull off is the names of each phone. class of that div is "_3wU53n"

Here is my code which returns an empty list:

import requests
from bs4 import BeautifulSoup

url = "https://www.flipkart.com/mobiles/pr?sid=tyy,4io&otracker=categorytree"
source = requests.get(url)

soup = BeautifulSoup(source.content, "html.parser")
data = soup.findAll('div',{'class':'_3wU53n'})
print data

kindly help.

  • There is no class '_3wU53n' in content. Check for yourself in the source code - view-source:https://www.flipkart.com/mobiles/pr?sid=tyy,4io&otracker=categorytree – Sachin Jun 03 '17 at 08:31
  • https://stackoverflow.com/questions/17597424/how-to-retrieve-the-values-of-dynamic-html-content-using-python Refer to this answer for help in retrieving dynamically generated DOM. – Sachin Jun 03 '17 at 08:37
  • this is for the first item in the list:
    Samsung Galaxy J3 Pro (Gold, 16 GB)
    . Instead of viewing source code, please inspect it.
    –  Jun 03 '17 at 09:11
  • Please check the question in the 2nd comment I mentioned. – Sachin Jun 03 '17 at 09:43

0 Answers0