Python Forum

Full Version: Opening small size browser with python selenium not work, need help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello;
trying to make python selenium opens browser in smaller size , but somehow the coding is not correct and it does not work,Wall
I am not good at selenium web driver.
I use Brave browser on windows 7, 64 bit, I use python 3.8 and selenium 4.1,
opening Brave browser in normal size with python/selenium works, no problem with that, so chromedriver is OK,

when I run my code, I don't get any error, but nothing happened, I get this:
"exited with code=0 in 0.985 seconds "
I appreciate your help,

here is my code;

def PIN():
    options = Options()
    options.binary_location = "C:\\Program Files (x86)\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"
    driver = webdriver.Chrome(chrome_options=Options, executable_path="C:\\_ChromeDriver-97.0.4692.71\\chromedriver.exe",)
    mobile_emulation = {
        "userAgent": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/90.0.1025.166 Mobile Safari/535.19"}
    options.add_experimental_option("mobileEmulation", mobile_emulation)
    options.add_argument("--log-level=3")

Mybot = webdriver.Chrome(chrome_options=Options)
    Mybot.set_window_size(500, 950)
    Mybot.get('https://www.google.com')