Automate extract domain
I am trying to extract domain name from a adblock rule , so what
pattern should i used to extract domain name only?
domains = ['ru', ' fr' ,'eu', 'com'] with open('easylist.txt', 'r') as f:
unique_result = list(set(result))
for r in unique_result: #Extract domain name out of url domain_name = r.split('.') #Check if domain name is in list of domains, only then add it
if domain_name in domains: print(r)
this one is labours process for that I have to find extension of all domain nd then add it into the domains. So I want something which could automate extract domain only