Skip to content

Instantly share code, notes, and snippets.

@virtualanup
Created June 16, 2016 13:33
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 virtualanup/e71c93f88624baaf5f9055748083a1cd to your computer and use it in GitHub Desktop.
Save virtualanup/e71c93f88624baaf5f9055748083a1cd to your computer and use it in GitHub Desktop.
View result of multiple symbol numbers at once
import requests
from bs4 import BeautifulSoup
startsym = 423599
endsym = 423638
for symbol in range(startsym, endsym+1):
strnum = str(symbol).zfill(7)
data = {
"symbol": strnum,
"Submit": "Submit"
}
# Make request
r = requests.post('http://slc.ntc.net.np/score.php', data=data)
soup = BeautifulSoup(r.text, "html.parser")
try:
container = soup.find("div", {"id": "show-result"}).find('h2')
point = container.text.split()[-1]
print(strnum, " got ", point)
except:
print(strnum," is not found in the list")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment