Created
December 21, 2021 17:48
-
-
Save YukariChiba/ad80ce9f72d85290fea5702741975d5f to your computer and use it in GitHub Desktop.
国际会议扫描器,助力搜索全球水会
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 requests as rq | |
| import bs4 | |
| def main(): | |
| for char1 in range(ord('a'), ord('z')+1): | |
| for char2 in range(ord('a'), ord('z')+1): | |
| for char3 in range(ord('a'), ord('z')+1): | |
| domain = "ic{}{}{}.org".format( | |
| chr(char1), chr(char2), chr(char3)) | |
| print("Trying {}".format(domain)) | |
| try: | |
| r = rq.get("http://{}".format(domain), timeout=5) | |
| if r.status_code == 200: | |
| h = bs4.BeautifulSoup(r.text, features="lxml") | |
| print(h.title.text.strip()) | |
| fo = open('result.txt', 'a+') | |
| fo.write("{}: {}\n".format(domain, h.title.text.strip())) | |
| fo.close() | |
| except: | |
| pass | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment