Created
June 16, 2016 13:33
-
-
Save virtualanup/e71c93f88624baaf5f9055748083a1cd to your computer and use it in GitHub Desktop.
View result of multiple symbol numbers at once
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
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