May-05-2020, 02:12 PM
Hi guys,
I have used this several times before and I simply cannot see what I am doing wrong here.
Previous code has extracted a list of data (data_id) under 'tag' - I just want to retrieve it and put it in an array.
Here's my code and output.
I have used this several times before and I simply cannot see what I am doing wrong here.
Previous code has extracted a list of data (data_id) under 'tag' - I just want to retrieve it and put it in an array.
Here's my code and output.
id = [] for id in tag: data_id = id.get('data-id') print(id.append(data_id),str(data_id)) #load id array list id.append(data_id)
Output:None 81568
None 176573
None 123466
None 124106
None 125505
None 161249
None 31776
The data is correct, just not being added to array (or rather being added as None)