Advertisement
Guest User

Untitled

a guest
May 2nd, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. driver = webdriver.Chrome(chrome_options=chrome_options, executable_path='/usr/lib/chromium-browser/chromedriver')
  2. File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 75, in __init__
  3. desired_capabilities=desired_capabilities)
  4. File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
  5. self.start_session(desired_capabilities, browser_profile)
  6. File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
  7. response = self.execute(Command.NEW_SESSION, parameters)
  8. File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
  9. self.error_handler.check_response(response)
  10. File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
  11. raise exception_class(message, screen, stacktrace)
  12. selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
  13. (Driver info: chromedriver=2.35 (0),platform=Linux 4.4.0-122-generic x86_64)
  14.  
  15. var config = {
  16. mode: "fixed_servers",
  17. rules: {
  18. singleProxy: {
  19. scheme: "http",
  20. host: "172.241.11.1",
  21. port: parseInt(29842)
  22. },
  23. bypassList: ["foobar.com"]
  24. }
  25. };
  26.  
  27. chrome.proxy.settings.set({value: config, scope: "regular"}, function() {});
  28.  
  29. function callbackFn(details) {
  30. return {
  31. authCredentials: {
  32. username: "aedqbb01",
  33. password: "ac7DMjR"
  34. }
  35. };
  36. }
  37.  
  38. chrome.webRequest.onAuthRequired.addListener(
  39. callbackFn,
  40. {urls: ["<all_urls>"]},
  41. ['blocking']
  42. );
  43.  
  44. {
  45. "version": "1.0.0",
  46. "manifest_version": 2,
  47. "name": "Chrome Proxy",
  48. "permissions": [
  49. "proxy",
  50. "tabs",
  51. "unlimitedStorage",
  52. "storage",
  53. "<all_urls>",
  54. "webRequest",
  55. "webRequestBlocking"
  56. ],
  57. "background": {
  58. "scripts": ["background.js"]
  59. },
  60. "minimum_chrome_version":"22.0.0"
  61. }
  62.  
  63. from selenium import webdriver
  64. from selenium.webdriver.chrome.options import Options
  65. from bs4 import BeautifulSoup
  66. chrome_options = Options()
  67. chrome_options.add_argument("--headless")
  68. #chrome_options.add_argument("--window-size=1920x1080")
  69. chrome_options.add_argument("user-agent=Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0")
  70. chrome_options.add_extension("proxy.zip") #where is manifest.json and background.json
  71. driver = webdriver.Chrome(chrome_options=chrome_options, executable_path='/usr/lib/chromium-browser/chromedriver')
  72. driver.get("https://www.google.com")
  73. soup = BeautifulSoup(browser.page_source, 'lxml')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement