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
  Python code for alignment and font size 1418 0 274 Jan-14-2024, 03:56 AM
Last Post: 1418
  How to do "fixed size" (wrapping) math in Python? AlexanderWulf 13 1,731 Jul-19-2023, 04:13 PM
Last Post: deanhystad
  Why is IDLE not opening on a MacOS Montery 12.6 and using Python 3.10.7? Merlin385 7 1,592 Oct-08-2022, 08:36 PM
Last Post: Merlin385
  Help in opening and editing an excel workbook from a web-browser test 4 1,357 Aug-10-2022, 02:31 PM
Last Post: test
  Opening CMD from Python Oshadha 2 1,242 Jul-17-2022, 11:22 PM
Last Post: Skaperen
  How to set Tab size to 4 in Python interpreter? zzzhhh 1 1,796 Jan-18-2022, 12:11 PM
Last Post: snippsat
  python keeps opening script directory Tyrel 5 2,935 Aug-06-2021, 10:43 PM
Last Post: snippsat
  Python Regular expression, small sample works but not on file Acernz 5 2,858 Jun-09-2021, 08:27 PM
Last Post: bowlofred
  Python OpenCV window not opening in fullscreen mode Zman350x 0 3,229 Apr-29-2021, 07:54 PM
Last Post: Zman350x
  cv2.imshow Python is not opening the window on top Petko 0 2,333 Feb-21-2020, 11:11 AM
Last Post: Petko

Forum Jump:

User Panel Messages

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