Created
April 26, 2017 16:34
-
-
Save shankcode/15675f95cfa5ac8ff6fb1e2d34b8c2fc to your computer and use it in GitHub Desktop.
Flipkart crawler for all categories link in .csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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