Web Scrape with Python

What is Web Scraping?

a technique to automatically access and extract large amounts of information from a website, which can save a huge amount of time and effort.

Important notes about web scraping

Inspecting the Website

It important to scan and check the website for the pupose of finding relevant pieces of code that contains our data. then simply do the “inspect”.

Python Code

-extract the actual link

one_a_tag = soup.findAll(‘a’)[38] link = one_a_tag[‘href’]

download_url = ‘http://web.mta.info/developers/’+ link urllib.request.urlretrieve(download_url,’./’+link[link.find(‘/turnstile_’)+1:])

time.sleep(1)