<reponame>DivyaMaddipudi/BeautifulSoup<filename>walmart/walmart_main.py
import urllib
import requests
import os
from bs4 import BeautifulSoup

def make_soup(url):
    page = urllib.request.urlopen(url)
    soupdata = BeautifulSoup(page, "html.parser")
    return soupdata

i = 181

soup = make_soup("https://www.walmart.com/browse/3944_1060825_3289709_1180168?povid=447913+%7C+contentZone1+%7C+2017-07-24+%7C+1+%7C+Perfection_AllTVs_TVs_By_4K")

for img in soup.findAll('img'):
    temp = img.get('data-image-src')
    #print(temp)

    if temp != None and i <=200:
        image = temp
        print(image)

        
                
        filename = str(i)
        i = i + 1    



        imagefile = open(filename + ".jpeg", "wb")
        imagefile.write(urllib.request.urlopen(image).read())
        imagefile.close()





import urllib
import requests
import os
from bs4 import BeautifulSoup

def make_soup(url):
    page = urllib.request.urlopen(url)
    soupdata = BeautifulSoup(page, "html.parser")
    return soupdata

i = 181

soup = make_soup("https://www.walmart.com/browse/3944_1060825_3289709_1180168?povid=447913+%7C+contentZone1+%7C+2017-07-24+%7C+1+%7C+Perfection_AllTVs_TVs_By_4K")

for img in soup.findAll('img'):
    temp = img.get('data-image-src')
    #print(temp)

    if temp != None and i <=200:
        image = temp
        print(image)

        
                
        filename = str(i)
        i = i + 1    



        imagefile = open(filename + ".jpeg", "wb")
        imagefile.write(urllib.request.urlopen(image).read())
        imagefile.close()
#print(temp)