在TEXT文件中,我需要删除流线和空格 后记,将xxx.xxx.xxx.xxx文本与“:”组合以分隔xxxx / xxxxx
Example:
192.xxx.xx.xx:2523
#Clean Socks4
o = open("ScrapedProxys.txt","w")
data = open("temp").read()
o.write(re.sub("Socks4","",data))
o.close()
#Remove temp
os.remove("temp")
#Remove all char
string = open('ScrapedProxys.txt').read()
new_str = re.sub('[a-zA-Z]', ' ', string)
open('ScrapedProxys.txt', 'w').write(new_str)
#Remove Blank lines
''.join(l for l in open('ScrapedProxys.txt') if l.rstrip())
带有代码的当前输出图像