Python Forum
Opening small size browser with python selenium not work, need help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Opening small size browser with python selenium not work, need help
#1
Question 
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')
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Why is IDLE not opening on a MacOS Montery 12.6 and using Python 3.10.7? Merlin385 7 463 Oct-08-2022, 08:36 PM
Last Post: Merlin385
  Help in opening and editing an excel workbook from a web-browser test 4 471 Aug-10-2022, 02:31 PM
Last Post: test
  Opening CMD from Python Oshadha 2 621 Jul-17-2022, 11:22 PM
Last Post: Skaperen
  How to set Tab size to 4 in Python interpreter? zzzhhh 1 958 Jan-18-2022, 12:11 PM
Last Post: snippsat
  python keeps opening script directory Tyrel 5 2,041 Aug-06-2021, 10:43 PM
Last Post: snippsat
  Python Regular expression, small sample works but not on file Acernz 5 1,767 Jun-09-2021, 08:27 PM
Last Post: bowlofred
  Python OpenCV window not opening in fullscreen mode Zman350x 0 2,278 Apr-29-2021, 07:54 PM
Last Post: Zman350x
  cv2.imshow Python is not opening the window on top Petko 0 1,788 Feb-21-2020, 11:11 AM
Last Post: Petko
  how to compare two different size images in python and find corresponding pixel value squidsirymchenry 1 3,415 Feb-03-2020, 06:48 AM
Last Post: michael1789
  Python opening a new command window m_lokeshkumar 1 1,335 Jan-05-2020, 09:01 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020