M
M
Master Ruby2021-08-20 18:30:30
Python
Master Ruby, 2021-08-20 18:30:30

How to open an element using Selenium?

def get_body(link, element2click):
    options = webdriver.ChromeOptions()
    driver = webdriver.Chrome(executable_path="D:\\WebDriver\\chromedriver.exe", options=options)
    driver.maximize_window()
    sleep(2)
    driver.get(link)  # puts here your link
    sleep(2)
    if element2click:
        driver.find_element_by_class_name(element2click).click()
    sleep(10)
    html = driver.page_source
    return html

I can’t open and display the content, I don’t know how to open the arrows:
611fca8336b3b372932879.jpeg
Here is the structure:
611fca06967f9864157363.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Prilepsky, 2021-08-27
@Dunaevlad

What's the problem? Just click on the arrow. If it doesn't work with selenium, then try clicking with JS

driver.executeScript("arguments[0].click();", element);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question