Reputation: 47
So I need to launch chrome from within Python (Preferably as a new window, not a tab), and then resize the window, move it and go to a specific URL.
I think I almost have it, it just won't launch chrome.
from pywinauto import application
app = application.Application()
app.start("Chrome.exe")
dlg_spec = app.window()
dlg_spec.move_window(x=None, y=None, width=500, height=500, repaint=True)
Any ideas?
Upvotes: 1
Views: 3015
Reputation: 47
So I found a solution to my problem, and here is my process:
from selenium import webdriver
driver = webdriver.Chrome(executable_path="C:\webdriver\chromedriver.exe")
driver.set_window_position(0,375)
driver.set_window_size(1920,705)
driver.get('https://dk.docendo.dk/calendar#/')
This code will do the following:
Hope this helps someone!
Upvotes: 2