scrapy-splash icon indicating copy to clipboard operation
scrapy-splash copied to clipboard

Handling multiple window or pop-ups

Open zero-master opened this issue 7 years ago • 3 comments

In Selenium, we can do it by using window_handles and switch_to_window method.

Before clicking the link first store the window handle as

window_before = driver.window_handles[0] after clicking the link store the window handle of a newly opened window as

window_after = driver.window_handles[1] then execute the switch to window method to move to newly opened window

driver.switch_to_window(window_after)

Is there any way to do it with Splash/Scrapy?

zero-master avatar Nov 02 '16 06:11 zero-master

No, multiple windows and non-js poopups are not supported by Splash at the moment.

kmike avatar Nov 02 '16 07:11 kmike

Thank you for the response.

Since you've emphasized that it doesn't work with "non-js popups".

Could you please tell me how I can handle JS popups? Just need some clues.

zero-master avatar Nov 02 '16 13:11 zero-master

I just meant that some popups are implemented as <div> elements over the webpage, as opposed to opening a new browser window, and you can work fine with these popups.

kmike avatar Nov 02 '16 14:11 kmike