Skip to content
Quentin Adt's Notes
The blog of Quentin Adt
About Quentin Adt SEO
    SEO Test Web performance
Development
    Shell linux Python Scripts
Digital Nomad
Quentin Adt's Notes
The blog of Quentin Adt
Home About Quentin Adt

Category: Python Scripts

Add column with domain name to CSV file with Python

February 10, 2021

A script to add a column containing only the domain name to an existing CSV file. It extract it from a column containing an URL. It works with .co.uk and other country code top-level domain. Just change “5” by the column containing the URL. Also don’t forget to adjust. Here is it setup for semi-colon for […]

Quentin Adt comment 0 Comments

Extract domain name with Python

February 10, 2021

tldextract is the best library to extract the domain name with Python. Here is how it looks in action: import tldextractext = tldextract.extract(‘http://forums.bbc.com’)print(ext.registered_domain) Which would output: bbc.co.uk

Quentin Adt comment 0 Comments