I am making a small project. The project is in the python and I am now stuck in a problem and i.e.
I have a list of URLs with their response code like 200, 300, 400, 403.
Okay let's make it more clear
http://aa.domain.com 200
http://bb.domain.com 302
http://cc.domain.com 400
http://dd.domain.com 403
http://ee.domain.com 403
Now what I exactly want is I want to seperate the URLs with their status code.
Like a "Making a Seperate list of 400 and 403 URLs".
How can I do it with python? As a newbie, I can't. Could You?
EDIT:- I have tried this
try:
req = requests.get(xxx) #xxx is a list of subdomains
responsecode = xxx , req.status_code, "\n"
print responsecode
except requests.exceptions.RequestException as e:
print "Not full fill request"
I only can print the response code. And successfully print the response code as like I said above