jabong seller details


import requests
from bs4 import BeautifulSoup
from openpyxl import Workbook
import urllib3
r= requests.get(url)
soup = BeautifulSoup(r.content)
soup.prettify()
# posts = soup.find_all(attrs={'class': 'post sponsorarea'})
#posts = soup.find_all("div",{"id":"seller-info-content"})
#print posts[0].text
wb = Workbook()# grab the active worksheet
ws = wb.active#
wc = Workbook()# grab the active worksheet
wa = wc.active#
wa['C1'] = "Jobong data"
wa.append(['Product','product Link','seller Address and Email'])

posts = soup.find_all("section",{"class":"row search-product animate-products"})
posts1 = posts[0].find_all("div",{"class":"col-xxs-6 col-xs-4 col-sm-4 col-md-3 col-lg-3 product-tile img-responsive"})
c = len(posts1)
print c
p=0
while p < c:
product = posts1[p].find_all("div",{"class":"h4"})
productLink = posts1[p].find_all("a")[0].get("href")

print "Product Name-->",product[0].text
print "Product Link -->","http://www.jabong.com/"+productLink
pro_url= "http://www.jabong.com/"+productLink

r1= requests.get(pro_url)
soup1 = BeautifulSoup(r1.content)
soup1.prettify()
# posts = soup.find_all(attrs={'class': 'post sponsorarea'})
posts3 = soup1.find_all("div",{"id":"seller-info-content"})
print posts3[0].text
wa.append([product[0].text,"http://www.jabong.com/"+productLink,posts3[0].text])
print "----------------------------------------"
p=p+1
f=wc.save("jobong.xlsx")

Comments

Popular posts from this blog

phppot.com main menu and sub menu scrap using python bs4