python日常案例汇集
2022/1/24 17:04:17
本文主要是介绍python日常案例汇集,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
python 操作DNSLOG平台
# -*- coding:utf-8 -*- import time import requests import os headers = { 'Cookie': 'UM_distinctid=17d9ee9b99ad5-08c6a2266360e7-4c3f2779-1fa400-17d9ee9b99b2b1; CNZZDATA1278305074=259968647-1640606623-%7C1643011913; PHPSESSID=kolveuasn829nk9s0jfffjg4n2' } getdomain = requests.get(url='http://dnslog.cn/getdomain.php', headers=headers, timeout=60) domain = str(getdomain.text) # 打印获取的随机域名 print(domain) # ping随机域名,使DNSlog平台有记录 os.system('ping '+domain+' -n 2') #多次刷新DNSlog平台,保证不是因为响应问题导致错过 for i in range(0,3): refresh = requests.get(url='http://dnslog.cn/getrecords.php', headers=headers, timeout=60) time.sleep(1) if domain in refresh.text: print("发现dns请求,脚本停止运行") break
这篇关于python日常案例汇集的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-08有遇到过吗?同样的规则 Excel 中 比Python 结果大
- 2024-03-30开始python成长之路
- 2024-03-29python optparse
- 2024-03-29python map 函数
- 2024-03-20invalid format specifier python
- 2024-03-18pool.map python
- 2024-03-18threads in python
- 2024-03-14python Ai 应用开发基础训练,字符串,字典,文件
- 2024-03-13id3 algorithm python
- 2024-03-13sum array elements python