Question: I am scraping images from a website, but the xpath varies for the element. I read [this post](https://stackoverflow.com/questions/44759907/find-element-by-class-name-for-multiple-classes) that an or function can be used by doing find\_elements\_by\_xpath. 

However, when I tried replicating the example, I could no longer extract the src of the image. Am I doing the or function wrong?

```
images=driver.find_elements_by_xpath('// img[ @ id = "ember51"]' or '// img[@id="ember52"]')
print(images.get_attribute('src'))

```

Error:

```
AttributeError: 'list' object has no attribute 'get_attribute'

```

I attempted to make a for loop, so the src could be scraped:

```
images=driver.find_elements_by_xpath('// img[ @ id = "ember51"]' or '// img[@id="ember52"]')
for image in images:
    print(images.get_attribute('src'))

```

But when I use a for loop, I get the same error. Not sure how to make this work.

Answer: 
You can try with CASE statement to achieve your required output. Check this below logic-

```
SELECT 
CASE 
    WHEN SCHEDULE_STATUS = 'SCHEDULED' THEN SCHEDULED_ON
    ELSE NULL
END 
FROM your_table

```

As per your clarification, you can use a simple select statement with WHERE condition as below-

```
SELECT * 
FROM your_table
WHERE SCHEDULE_STATUS = 'SCHEDULED'

```
This is one of many ways to achieve what you desire:

1. `*` selects all columns data from the table, if you don't want to show that last column then just select the first two columns,
2. t1 is your current table,
3. Query the table to only retrieve data where the `Schedule_Status` is `NOT_SCHEDULED`.

```
SELECT Name, Schedule_Status
FROM t1 
WHERE t1.Schedule_Status = "NOT_SCHEDULED";

```