A
A
aftnia112022-02-26 14:26:05
Python
aftnia11, 2022-02-26 14:26:05

Is it possible to select the next element if the search is by class name?

Good day.

driver.find_element_by_class_name('slide').get_attribute('src')

This is how I pull out the link to the image from the site. But the trouble is that only the first link is taken.
Is there any way to iterate through them all? Or a few, say the first 20.
As I understand it, the trouble is that get_attribute takes only the first value and converts it to a string, and does not save all links as a list

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2022-02-26
@aftnia11

I understand the trouble is that get_attribute takes only the first value

The trouble is that the find_element method finds one element . There are other methods called find_element s . It's already just through the cycle to go through everything and get what you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question