Guest User

Untitled

a guest
Dec 10th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. from selenium import webdriver
  2. self.driver = webdriver.Chrome()
  3.  
  4. ps afvvx | grep chrome
  5.  
  6. /opt/google/chrome/chrome --disable-background-networking --disable-client-side-phishing
  7. 21026 pts/2 S+ 0:00 0 47 6008 100 0.0 | _ cat
  8. 21027 pts/2 S+ 0:00 0 47 6008 100 0.0 | _ cat
  9. 21029 pts/2 Z+ 0:00 0 0 0 0 0.0 | _ [chrome-sandbox] <defunct>
  10.  
  11. # /opt/google/chrome/chrome-sandbox -h
  12. The setuid sandbox provides API version 1, but you need 0
  13. Please read [https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment][1].
  14.  
  15. close: Bad file descriptor
  16. Read on socketpair: Success
  17.  
  18. import time
  19. from selenium import webdriver
  20.  
  21. from xvfbwrapper import Xvfb
  22.  
  23. vdisplay = Xvfb()
  24. vdisplay.start()
  25.  
  26. from selenium.webdriver.chrome.options import Options
  27. chrome_options = Options()
  28. chrome_options.add_argument("--no-sandbox")
  29. chrome_options.add_argument("--disable-setuid-sandbox")
  30.  
  31. driver = webdriver.Chrome('/usr/local/sbin/chromedriver', chrome_options=chrome_options) # Optional argument, if not specified will search path.
  32. driver.get('http://www.google.com/xhtml');
  33. time.sleep(5) # Let the user actually see something!
  34. search_box = driver.find_element_by_name('q')
  35. search_box.send_keys('ChromeDriver')
  36. search_box.submit()
  37. time.sleep(5) # Let the user actually see something!
  38. driver.quit()
  39.  
  40. vdisplay.stop()
  41.  
  42. /opt/google/chrome/google-chrome --no-sandbox --disable-setuid-sandbox --disable-background-networking --disable-client-side-phishing-detection --disable-component-update --disable-default-apps --disable-hang-monitor --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-logging --ignore-certificate-errors --load-extension=/tmp/.com.google.Chrome.a0gQAp/internal --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12512 --safebrowsing-disable-auto-update --safebrowsing-disable-download-protection --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.com.google.Chrome.dgq4j1 data:,
  43. [39330:39330:0501/130308:ERROR:browser_main_loop.cc(185)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
  44. Xlib: extension "RANDR" missing on display ":1070".
  45. Xlib: extension "RANDR" missing on display ":1070".
  46. [39330:39330:0501/130308:ERROR:desktop_window_tree_host_x11.cc(830)] Not implemented reached in virtual void views::DesktopWindowTreeHostX11::InitModalType(ui::ModalType)
  47.  
  48. (google-chrome:39330): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
  49. /usr/bin/dbus-launch terminated abnormally without any error message
  50. [39330:39353:0501/130308:ERROR:browser_gpu_channel_host_factory.cc(151)] Failed to create channel.
  51.  
  52. apt-get install dbus-X11
Add Comment
Please, Sign In to add comment