Skip to content

Instantly share code, notes, and snippets.

@shankcode
Created April 26, 2017 16:34
Show Gist options
  • Save shankcode/15675f95cfa5ac8ff6fb1e2d34b8c2fc to your computer and use it in GitHub Desktop.
Save shankcode/15675f95cfa5ac8ff6fb1e2d34b8c2fc to your computer and use it in GitHub Desktop.
Flipkart crawler for all categories link in .csv
import requests
from bs4 import BeautifulSoup
import csv
#FOR WRITTING RESULT IN CSV FILE
fw = csv.writer(open('shank.csv', 'w'))
fw.writerow('link')
#FOR WEBSITE SCRAPPING
con = BeautifulSoup(open("C:/Users/Shank/Desktop/fkart.xml"))
all_loc = con.findAll('loc')
for loc in all_loc:
each_link = loc.string
#CALLING CSV FILE AND WRITING INTO IT
fw.writerow([each_link])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment