 <p>It looks like you are grabbing the first element after you split the line. That is going to give you the date, according to your example CSV file.</p> <p>What you probably want instead (again, assuming the example is the way it will always work) is to grab the 3rd element, so something like this:</p> <pre><code>csv_domain = line.split(',')[2] </code></pre> <p>But, like one of the comments said, this isn't necessarily fool proof. You are assuming none of the individual cells will have commas. Based on your example that might be a safe assumption, but in general when working with CSV files I recommend working with the <a href="https://docs.python.org/3/library/csv.html" rel="nofollow">Python csv module</a>.</p>