Answer the question
In order to leave comments, you need to log in
Why doesn't chromium (selenium python) remove .org.chromium.Chromium.16etJh files?
Hello!
There is a script which tests a web page. Runs on Linux, written in Python , selenium , ChromeDriver 2.40.565383
The script runs around the page, extracts data, adds it to the database and then closes the API driver.quit()
And so every 15 minutes.
Here is an abstract example
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from pyvirtualdisplay import Display
from sys import exit
import time
import re
import pymysql.cursors
import sys
while True:
#this is body code
# Start virtual display
display = Display(visible=0, size=(1024, 768))
display.start()
# Initialization selenium driver
chrome_options = Options()
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-setuid-sandbox")
chrome_options.add_argument("user-data-dir=/tmp/ChromeSelenium/loda/");
driver = webdriver.Chrome('./drivers/chromedriver', chrome_options=chrome_options)
driver.get("URL")
SOME_CODE_HERE
# Quit Selenium driver
driver.quit()
# Stop virtual display
display.stop()
# Sleep before starting new loop
print ('Set pausa time')
for i in range(900, 0, -1):
sys.stdout.write(str(i) + ' ')
sys.stdout.flush()
time.sleep(1)
/.org.chromium.Chromium.16etJh
/.org.chromium.Chromium.izddfJh
/.org.chromium.Chromium.przJwN
/.org.chromium.Chromium.qmbBd
chrome_options.add_argument("user-data-dir=/tmp/ChromeSelenium/moda/");
/tmp/.*
Answer the question
In order to leave comments, you need to log in
This is most likely a bug
I fixed it by adding it to crontab
With Firefox, as far as I remember, the same problem
PS
# Sleep before starting new loop
print ('Set pausa time')
for i in range(900, 0, -1):
sys.stdout.write(str(i) + ' ')
sys.stdout.flush()
time.sleep(1)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question