-1

is it possible run functions in diferents tabs at the same time?(firefox)

let me explain

I am doing scraping...then I want to open a diferent tabs and to do scraping in these at the same time.

I used to do it using different windows (the easy way). But now the web I scraped dont let me to be loggin in diferentes windows. but if it is in the same windows with multiple tabs I can be logged in everyone.

or maybe there is other way: Is there a way to run two diferents script in the same windows?. For example, run the first script and later that the second script open a new tab in the windows opened for the first script?

Thank you for the help.

ozo
  • 883
  • 1
  • 10
  • 18
  • might be able to copy the cookies over? : https://stackoverflow.com/a/38812576/2026508 – jmunsch Dec 13 '17 at 20:58
  • Possible duplicate of [Selenium multiple tabs at once](https://stackoverflow.com/questions/18150593/selenium-multiple-tabs-at-once) – sytech Dec 13 '17 at 21:44
  • I think is not duplicate. The question is the 2013. Now firefox support multiprocess. – ozo Dec 13 '17 at 21:45

1 Answers1

0

In short, no. In a single Selenium webdriver instance, you can only interact with a single window handle at any given time. This answer has more related details you may find pertinent.

With regard to running two different scripts on the same window in different tabs... it is (or at least was at some point in time) technically possible to do in at least Internet Explorer. Selenium maintainers decided that it would not be feasible to implement a general solution for this. While you may find a hack to do this, it almost certainly will be browser-specific and very fragile, therefore not recommended.

Your best bet will be to just have two separate instances.

sytech
  • 29,298
  • 3
  • 45
  • 86