Skip to content

Instantly share code, notes, and snippets.

@hemangsk
Created November 23, 2017 09:49
Show Gist options
  • Save hemangsk/ef604e5d82dd8212d21f7f6f6a7a131b to your computer and use it in GitHub Desktop.
Save hemangsk/ef604e5d82dd8212d21f7f6f6a7a131b to your computer and use it in GitHub Desktop.
# coding: utf-8
# In[1]:
import requests
# In[4]:
r = requests.get('https://enquiry.indianrail.gov.in/xyzabc/LiveStation?stnCode=DLI&toStnCode=&withinHrs=2&trainType=ALL&scrnSize=s&langFile=props.en-us')
r.text
# In[5]:
r
# In[6]:
r.headers
# In[7]:
r.text
# In[35]:
from bs4 import BeautifulSoup
# In[36]:
soup = BeautifulSoup(r.text, "html5lib")
# In[38]:
soup.find_all('table', {'class': 'allTrainsViaStn'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment