Skip to content

Instantly share code, notes, and snippets.

@arijitx
Created August 10, 2017 14:27
Show Gist options
  • Save arijitx/f5031949add441bec95b48fd171eeb7b to your computer and use it in GitHub Desktop.
Save arijitx/f5031949add441bec95b48fd171eeb7b to your computer and use it in GitHub Desktop.
import requests
import re
url ="http://moodle.iitb.ac.in/mod/forum/discuss.php?d=62595"
s=requests.session()
r = s.post("http://moodle.iitb.ac.in/login/index.php", data={'username':'roll_no','password':'pass'})
r2 = s.get(url)
count=0
ind=0
while(1):
ind=r2.text.find("+1",ind+1)
if ind==-1:
break
count+=1
print count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment