Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Saturday, January 18, 2020

simple csv reader in python

import csv
datafile = open('touristspot-final.csv', 'r')
myreader = csv.reader(datafile)

for row in myreader:
    print(row[0], row[1], row[2])

Please make sure to install csv package in python.

Python selenium installation

Make sure you have pip installed. Generally it comes with the package already.

Now install selenium
C:\Python34\Scripts\pip.exe install -U selenium
Later you have to download the browser driver (either for firefox or chrome etc) - just google it to get the location. The downloaded stuffs path needs to be used in python code.

Rest of the other related stuffs are as below -- used for data scraping
pip install beautifulsoup4

pip install requests