Created
June 1, 2020 13:19
-
-
Save rakaar/cfab48be8c6c727a6249c2914d74aad5 to your computer and use it in GitHub Desktop.
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
# 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