![]() |
|
http response checker - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Python (https://sinister.ly/Forum-Python) +--- Thread: http response checker (/Thread-http-response-checker) Pages:
1
2
|
http response checker - Inori - 08-30-2015 I made this for a project @Eclipse gave me, and I think some people here may benefit from it. Run in terminal or command line, it takes a site for a parameter, then acts as a browser and checks the site's http response. Acting as a browser using a User-agent may fool some anti-bot systems, but not ones like cloudflare. Any solution to this issue would be hugely appreciated. Source: Code: import requests
import sys
url = sys.argv[1]
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'}
r = requests.get(url, headers=headers)
print r.status_codeUsage: Code: $ python resp.py https://github.comIf you don't already have Requests installed, install it using pip Code: $ pip install requestsRE: http response checker - Eclipse - 08-30-2015 Ahh, you did it in Python. That was unexpected. Good job. Oh, and you can use this to fool cloudflare: https://github.com/Anorov/cloudflare-scrape RE: http response checker - Satan - 08-30-2015 (08-30-2015, 12:27 AM)eclipse Wrote: Ahh, you did it in Python. That was unexpected. Good job. Think I sent that already to him over Skype lmfao. RE: http response checker - Dyme - 08-30-2015 Lol did u really feel the need to make a thread for this... RE: http response checker - Inori - 08-30-2015 (08-30-2015, 12:27 AM)eclipse Wrote: Ahh, you did it in Python. That was unexpected. Good job. (08-30-2015, 12:28 AM)Jinx Wrote: Think I sent that already to him over Skype lmfao. Was trying to find a way to do it without using another import RE: http response checker - Yung Gud - 08-30-2015 lol what is the point of this it has literally no use RE: http response checker - Eclipse - 08-30-2015 (08-30-2015, 12:31 AM)Dyme Wrote: Lol did u really feel the need to make a thread for this... (08-30-2015, 12:46 AM)Yung Gud Wrote: lol what is the point of this it has literally no use Was meant as a personal project to improve OP's networking skills. He made a thread. Big whoop. RE: http response checker - Dyme - 08-30-2015 (08-30-2015, 12:46 AM)Yung Gud Wrote: lol what is the point of this it has literally no use ikr right like is he proud that he was able to read basic documentation or something lol ![]() (08-30-2015, 12:52 AM)eclipse Wrote: Was meant as a personal project to improve OP's networking skills. He made a thread. Big whoop. he was able to copy and paste. big whoop. RE: http response checker - Eclipse - 08-30-2015 (08-30-2015, 12:56 AM)Dyme Wrote: ikr right like is he proud that he was able to read basic documentation or something lol What did you expect? It's python. No one said he's good at it, but he might have learned something; something that might come in useful for the next thing. RE: http response checker - Dyme - 08-30-2015 (08-30-2015, 01:00 AM)eclipse Wrote: What did you expect? It's python. No one said he's good at it, but he might have learned something; something that might come in useful for the next thing. I'm not claiming he isn't good... also what do you mean what did I expect? Yeah this is the best way to go about getting status codes in python, but so what? OP did nothing other than glance at some documentation to write something in a couple of minutes and you're acting like I'm supposed to give a fuck lol?? I'm glad he learned something that's great, but like who cares. It's like posting a thread: "Hi GUys!!! Today I learned how to make a HELLOW WORLD in C++!!! Here is the code thanks for viewing !!!!" like wow congrats dude what do u want an award??? |