Reputation: 119
I've got a .csv with 10,000+ rows of queries that I'd like to add on to the end of a domain (www.abcdef.com/xxxxxx).
What is the best way to go about building all of these URLs?
I'm a python beginner and I know how to generate a list based off using a manually created dictionary, but how do I read/write from a .csv row by row?
Any input is appreciated.
Upvotes: 1
Views: 79
Reputation: 6387
For reading and writing CSV see csv module.
For manipulating URLs, see urlparse.urljoin (in Python3 urlllib.parse
module)
I would also recommend to use set()
for storing URL for each domain. You avoid duplicates this way.
Upvotes: 1