db_gg
db_gg

Reputation: 129

How to iterate through web pages in chrome using WebDriver Selenium in python?

I have a written a program that will open windows in chrome, iterate through them to find a specific one and close that window if found.

I used a Mac OS python import and am having trouble converting this line:

for item in app('Web Chrome').window[0].tabs():

into a windows friendly version using webdriver. Any ideas?

Upvotes: 0

Views: 333

Answers (1)

j.barrio
j.barrio

Reputation: 1036

Did you try with window_handle function?

for handle in driver.window_handles:
    driver.switch_to_window(handle)

Upvotes: 1

Related Questions