Last active
August 29, 2015 14:03
-
-
Save freetstar/5a2f09a6a93cc83e4fba to your computer and use it in GitHub Desktop.
monitor新一代
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 | |
import datetime | |
#get the session id and set the cookies | |
payload4sessionid={'USER':'guest','PASSWORD':'guest','IMAGE_HEIGHT':'170','IMAGE_WIDTH':'1255','TabHeight':'580'} | |
index = requests.get("http://10.226.72.29:8080/nmmis/servlet/LoginServlet",params=payload4sessionid) | |
sessionid= index.cookies['JSESSIONID'] | |
cookies = dict(JSESSIONID=sessionid) | |
#get index page | |
indexContent=requests.get("http://10.226.72.29:8080/nmmis/jsp/rmsupervise/index.jsp?index=01",cookies=cookies) | |
#set the target time | |
now = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:00:00") | |
targetTime= now | |
payload4tabMainContent={'id':'file','type':'TAB_CONTENT_FILE','startTime':targetTime} | |
tabMainContent=requests.get("http://10.226.72.29:8080/nmmis/jsp/rmsupervise/tabMainContent.jsp",params=payload4tabMainContent,cookies=cookies) | |
print tabMainContent.text | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment