Selenium, got list of results, by applying for x in y, got the list with same result


Could someone check the code and show me my mistake:

Can not create dictionary with all results.
if I check

for i in boxes:

I get the list with data what I am looking for.
If I want to "split" it for parsing, then I get same number of results, but value is the same for all results. For example I get 20 lines of the same data.

url = ''

boxes = driver.find_elements('css selector',
                                 "div[class='Box-sc-wfmb7k-0 jYFQjC']"

for item in boxes:
    question = {
    'title' : driver.find_element('css selector',
                                  "div[class='Box-sc-wfmb7k-0 dZUXGn']"
    'link' : driver.find_element('css selector',
                                  "a[class='AnchorLink__StyledAnchor-sc-1ep83ox-0 inWMrO ResultListAdRowLayout___StyledClientRoutingAnchorLink-sc-1rmys2w-1 houIJO']"
    'size' : driver.find_element('xpath',


'title' : item.find_element('css selector',
                                  "div[class='Box-sc-wfmb7k-0 dZUXGn']"

Find from current item and not driver.

Answered By – Arundeep Chohan

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published