Nov-26-2020, 02:23 PM
Hi,
I am very new to Python. I am trying to scrape a website and I have create a small code for this:
Thank you
I am very new to Python. I am trying to scrape a website and I have create a small code for this:
select = Select(character.find_element_by_id('character-template-choice')) options = select.options for index in range(0, len(options) - 0): select.select_by_index(index) option1 = character.find_elements_by_class_name('pc-stat-value') power = [] for c in option1: power.append("Power:" + c.text) option2 = character.find_elements_by_class_name( 'unit-stat-group-stat-label') skills = [] for a in option2: skills.append(a.text) option3 = character.find_elements_by_class_name( 'unit-stat-group-stat-value') values = [] for b in option3: values.append(b.text) test = [power, skills, values]The issue I have is when I try to export "test" list of lists to csv I only get the last iteration. I want to get the data for every iteration but I don't know how to do so. Can someone help me?
Thank you