I recently posted this as a possible answer to the question How to use Selenium Safari Webdriver . The problem with my answer is that the entry from the jar file appears in the terminal when the python script runs, and I would like to disable it. Can this be done via python?
Using Python 2.7.5 and the selenium module python (2.41.0) on Mac OSX.
This example opens the Safari browser and my bids:
# -*- coding: utf-8 -*- print ''' Python Selenium Safari Example ''' from selenium import webdriver from selenium.webdriver.common.keys import Keys import os # path to selenium server standalone jar, downloaded here: # http:
but here is what appears in the terminal when I run it:
$ python selenium_safari_example.py Python Selenium Safari Example May 27, 2014 4:24:17 PM org.openqa.grid.selenium.GridLauncher main INFO: Launching a standalone server 16:24:17.918 INFO - Java: Apple Inc. 20.65-b04-462 16:24:17.918 INFO - OS: Mac OS X 10.7.5 x86_64 16:24:17.975 INFO - v2.41.0, with Core v2.41.0. Built from revision 3192d8a 16:24:18.418 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: MAC 16:24:18.597 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:61893/wd/hub 16:24:18.598 INFO - Version Jetty/5.1.x 16:24:18.599 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver] 16:24:18.600 INFO - Started HttpContext[/selenium-server,/selenium-server] 16:24:18.600 INFO - Started HttpContext[/,/] 16:24:18.724 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@75e845c2 16:24:18.724 INFO - Started HttpContext[/wd,/wd] 16:24:18.732 INFO - Started SocketListener on 0.0.0.0:61893 16:24:18.732 INFO - Started org.openqa.jetty.jetty.Server@1ac88440 16:24:27.335 INFO - Executing: [new session: Capabilities [{platform=ANY, javascriptEnabled=true, browserName=safari, version=}]] at URL: /session) 16:24:27.351 INFO - Creating a new session for Capabilities [{platform=ANY, javascriptEnabled=true, browserName=safari, version=}] 16:24:27.580 INFO - Server started on port 1988 16:24:27.772 INFO - Launching Safari 16:24:27.928 INFO - Waiting for SafariDriver to connect 16:24:39.589 INFO - Connection opened 16:24:39.610 INFO - Driver connected in 11681 ms 16:24:39.813 INFO - Done: /session 16:24:39.917 INFO - Executing: [implicitly wait: 10000] at URL: /session/24ca27ce-7f06-4d16-ab8f-3d7376b01eea/timeouts/ implicit_wait) 16:24:39.962 INFO - Done: /session/24ca27ce-7f06-4d16-ab8f-3d7376b01eea/timeouts/implicit_wait 16:24:39.967 INFO - Executing: [get: http://google.com/] at URL: /session/24ca27ce-7f06-4d16-ab8f-3d7376b01eea/url) 16:24:47.853 INFO - Done: /session/24ca27ce-7f06-4d16-ab8f-3d7376b01eea/url 16:24:47.860 INFO - Executing: [find element: By.selector:
when the only thing I want to show is:
$ python selenium_safari_example.py Python Selenium Safari Example Press Enter to close... $
How to stop the appearance of selenium logs in the terminal?
python selenium selenium-webdriver safari-extension macos
Loknar
source share