from selenium import webdriver
from xvfbwrapper import Xvfb
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.service import Options
vdisplay = Xvfb()
vdisplay.start()
chrome_options = webdriver.ChromeOptions()
#chrome_options.add_argument('headless')
#chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-setuid-sandbox")
#driver = webdriver.Chrome('/chrome/chromedriver', chrome_options=chrome_options)
#driver = webdriver.Chrome('/chrome/chromedriver', options=chrome_options)
s = Service('/chrome/chromedriver')
driver = webdriver.Chrome(service=s, options=chrome_options)
driver.get('http://test.ru/helper.php')
ff = open("file.txt", "w")
ff.write(driver.page_source.encode("utf-8"))
ff.close()
print(browser.title)
driver.close()
vdisplay.stop()
from selenium import webdriver
from xvfbwrapper import Xvfb
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.service import Options
vdisplay = Xvfb()
vdisplay.start()
chrome_options = webdriver.ChromeOptions()
#chrome_options.add_argument('headless')
#chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-setuid-sandbox")
#driver = webdriver.Chrome('/chrome/chromedriver', chrome_options=chrome_options)
#driver = webdriver.Chrome('/chrome/chromedriver', options=chrome_options)
s = Service('/chrome/chromedriver')
driver = webdriver.Chrome(service=s, options=chrome_options)
driver.get('http://test.ru/helper.php')
ff = open("file.txt", "w")
ff.write(driver.page_source.encode("utf-8"))
ff.close()
print(browser.title)
driver.close()
vdisplay.stop()