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
Larz60+ write Nov-26-2020, 10:25 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
I fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
I fixed for you this time. Please use bbcode tags on future posts.