Skip to content

Instantly share code, notes, and snippets.

@rakaar
Created June 1, 2020 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rakaar/cfab48be8c6c727a6249c2914d74aad5 to your computer and use it in GitHub Desktop.
Save rakaar/cfab48be8c6c727a6249c2914d74aad5 to your computer and use it in GitHub Desktop.
# Credits - Mukul
import os
import csv
import time
from selenium import webdriver
baseURL = "SOME URL"
driver = webdriver.Chrome()
def scrapePage(url):
driver.get(url)
time.sleep(2)
rows = driver.find_elements_by_tag_name("tr")
res = []
for row in rows:
res.append(row.text)
return res
grantInfo = []
for i in range(1, 85):
url = baseURL + str(i)
data = scrapePage(url)
grantInfo.append(data)
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment