.csv ファイルから URL を読み取っていて、それらを解析しようとしています。関数にリンクを明示的に配置すると、 schemeとnetlocで正しい値しか得られないのはなぜですか。urlparse(...)
o2
newsource
urlparse
for line in file:
source = str(line.split(",")[2])
print("ORIGINAL URL: \n" + source)
newsource = source.replace('"',"")
print("REMOVING QUOTES: \n" + newsource)
newsource.strip
print("STRIPPING SPACES: \n" + newsource + "\n")
o = urlparse(newsource)
print("RESULT PARSING: " + str(o) + "\n")
o2 = urlparse("http://nl.aldi.be/aldi_vlees_609.html")
print("RESULT MANUAL PARSING: " + str(o2) + "\n")