Extract 2nd level domain from domain? - Python
Problem in mix of extractions 1st and 2nd level.
Trivial solution...
Build list of possible site suffixes, ordered from narrow to common case.
"co.uk",  "uk", "co.jp", "jp", "com"
And check, Can suffix be matched at end of domain. if matched, next part is site.
I have a list of domains e.g.

site.co.uk
site.com
site.me.uk
site.jpn.com
site.org.uk
site.it

also the domain names can contain 3rd and 4th level domains e.g.

test.example.site.org.uk
test2.site.com

I need to try and extract the 2nd level domain, in all these cases being site

Any ideas? :)