Y
Y
yuki2021-01-22 17:34:12
Python
yuki, 2021-01-22 17:34:12

How to open a separate chrome tab using python language?

Hey! It is interesting to know how through python WITHOUT SELENIUM to open a google chrome tab with launch options -app=" localhost:5000 ". That is, in selenium it looks something like this

url = "http://localhost:5000/"
    opt = webdriver.ChromeOptions()
    opt.add_argument("-app=" + url)
    opt.add_argument(f"--window-size=1280,720")
    opt.add_argument("--window-position={},{}".format(cx, cy))
    w = webdriver.Chrome(options=opt, keep_alive=True)

Cool? Well, like yes, but no, because the startup time of chromedriver is very long (about 5 seconds + additional time is spent on ajax requests). Are there options to work directly with Google without intermediaries in the form of a driver?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
acwartz, 2021-01-22
@rstJkee

Through the DevTools protocol, perhaps. hiss hose package: https://github.com/fate0/pychrome

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question