Maybe it's a silly question but I'm really stuck on this one.
I have a dictionary of string, I extract all string from the key avis_technique but I don't know how to store each string into a single list and remove all empty string.
for material in materials['materials']:
avis_tech = material['details'].get('avis_technique')
urls = avis_tech.split(', ')
print(urls)
Currently my output I something like this:
['']
['']
['']
['']
['http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf']
['http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf']
['http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf']
['http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf']
['http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf']
['http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf']
['http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf']
['http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf']
['http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf']
['']
['']
['']
['']
['']
My goal is to have:
['http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf','http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf','http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf','http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf','http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf','http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf','http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf','http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf','http://www.cstb.fr/pdf/atec/GS20-U/AU21482_V1.pdf']