Last active
May 23, 2017 19:15
-
-
Save fndiaz/5879208 to your computer and use it in GitHub Desktop.
requisições http
This file contains hidden or 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 urllib2 | |
import urllib | |
from cookielib import CookieJar | |
from xml.dom.minidom import parseString | |
cj = CookieJar() | |
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) | |
response = opener.open("http://192.168.1.100/astmanager/asterisk/mxml?action=login&username=user&secret=senha") | |
var = response.read() | |
print var | |
action = opener.open('http://192.168.1.100/astmanager/asterisk/mxml?action=queuestatus') | |
var = action.read() | |
dom = parseString(var) | |
print dom | |
xmlTag = dom.getElementsByTagName('response')[0].toxml() | |
print xmlTag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment