Created
December 17, 2016 05:51
-
-
Save raj454raj/4cefbc2a58b6a1a26477f284952672a8 to your computer and use it in GitHub Desktop.
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
from bs4 import BeautifulSoup | |
session = requests.Session() | |
response = session.get("http://lightoj.com/login_main.php") | |
print response | |
cookies = session.cookies.get_dict() | |
response = session.post("http://lightoj.com/login_check.php", | |
data={"myuserid": "hsharma@maileme101.com", | |
"mypassword": "admin123", | |
"Submit": "Login"}, | |
headers={"Cookie": "PHPSESSID=" + cookies["PHPSESSID"]}) | |
response = session.get("http://lightoj.com/index.php", | |
headers={"Cookie": "PHPSESSID=" + cookies["PHPSESSID"], | |
"Referer": "http://lightoj.com/login_success.php"}) | |
response = session.post("http://lightoj.com/volume_submissions.php", | |
data={"sub_user_id": "3169"}) | |
soup = BeautifulSoup(response.text) | |
trs = soup.find_all("table", {"id": "mytable3"})[1].find_all("tr") | |
print len(trs) | |
for tr in trs: | |
print tr | |
print "*****************************" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment