CSV write problems in python

I saved the captured structure in a list, and then wrote it into a CSV file, only to find that one letter occupies a cell. I have tried several methods, but I hope the master can point me out

.
ulist = []
for i in range(1,2):
    -sharp
    new_url = url.format(i)
    print(new_url)
    try:
        r = requests.get(new_url,timeout=30)
        r.raise_for_status()
        r.encoding = r.apparent_encoding
    except:
        print("")

    demo = etree.HTML(r.content) 
    selc=demo.xpath("//value[@lang_id=""]")
    i = 1
    for a in selc:
        -sharpsring
        info = a.xpath("string(.)")
        ulist.append(info)

    print(ulist)

with open("F:\\12.csv","w",newline=None) as f:
    writer = csv.writer(f)   
    writer.writerows(ulist.split(""))
    f.close
       
Mar.07,2021

how does the list object have a split method?

Menu