做出一个收集语言python代码
时间: 2024-02-04 14:03:20 浏览: 86
以下是一个收集Python代码的示例:
```python
import os
import time
import tkinter.filedialog
import pandas as pd
import whois
import socket
def pd_cdn(ym):
q1 = os.popen(f'nslookup {ym}')
q2 = q1.read()
q3 = q2.count('.')
if q3 > 10:
print(f'{ym}使用了cdn技术')
else:
print(f'{ym}没有使用cdn技术')
def get_file():
data_1 = tkinter.filedialog.askopenfilename(title="选择文件")
data = data_1
print('路径为:', data)
x = pd.read_excel(data)
field_sync_l = \[\]
field_sync_r = \[\]
for o in range(0, len(x.columns)):
field_sync_l.append(x.loc\[0\]\[o\])
print(field_sync_l)
for o in range(0, len(x.columns)):
field_sync_r.append(x.loc\[1\]\[o\])
print(field_sync_r)
entry.delete(0, END)
entry.insert(0, data)
def whois_check(ym):
q1 = whois.whois(ym)
print(q1)
def ip_check(ym):
ip = socket.gethostbyname(ym)
print(ip)
def domain_scaner(ym):
for ymqz in open('dic.txt'):
ymqz = ymqz.replace('\n', '')
url = ymqz + '.' + ym
try:
ip = socket.gethostbyname(url)
jg = ip + '|' + url
print(jg + '\n')
except Exception as e:
pass
def information_check():
ym = input('输入域名:')
ip_check(ym)
whois_check(ym)
pd_cdn(ym)
domain_scaner(ym)
information_check()
```
这段代码包含了收集域名信息的功能,包括查询域名的IP地址、Whois信息、判断是否使用了CDN技术以及收集子域名等功能。你可以根据自己的需求进行修改和扩展。
#### 引用[.reference_title]
- *1* *3* [python编写信息收集工具](https://blog.csdn.net/m0_55306747/article/details/121046772)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [使用python写一个代码生成器](https://blog.csdn.net/qq_53521409/article/details/128071999)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文