Q: How to prevent adding duplicated items to lists How to prevent adding duplicated items to both of these lists?

while len(list) <= 250:
    class_name=[]
    class_name = driver.find_elements_by_class_name('_1oem')
    
    for item in class_name:
        if item not in list:
            list.append(item.get_attribute('href'))
            print('Total: ', len(list))


A: Is the order of the items important? If not, you can use a Set object, which does not allow for duplicate objects. It could look something like this:
s = set()
while len(s) <= 250:
    class_name=[]
    class_name = driver.find_elements_by_class_name('_1oem')
    
    for item in class_name:
        name = item.get_attribute('href')
        if(name not in s):
            print('Total: ', len(s))        
        s.add(name)

The Set utilizes a process called hashing which speeds up lookup of elements, making even the if(name not in s) line take less time than a similar expression with a list instead.

A: Your list contains all the links which are there in href but your if condition does not match to this.
The code should be something like this
while len(list) <= 250:
    class_name=[]
    class_name = driver.find_elements_by_class_name('_1oem')
    
    for item in class_name:
        item_link=item.get_attribute('href')
        if item_link not in list:
            list.append(item_link)
            print('Total: ', len(list))

