Skip to content

Commit

Permalink
once more with feeling
Browse files Browse the repository at this point in the history
  • Loading branch information
ilude committed Mar 25, 2024
1 parent cc0711b commit dc8493d
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@

app = Flask(__name__)

# Create a headless browser instance
options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--headless')
options.add_argument('--disable-gpu')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--profile-directory=Default')
options.add_argument('--user-data-dir=~/.config/google-chrome')
driver = webdriver.Chrome(options=options)
try:
os.makedirs('app/static/screenshots')
# Create a headless browser instance
options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--headless')
options.add_argument('--disable-gpu')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--profile-directory=Default')
options.add_argument('--user-data-dir=~/.config/google-chrome')
driver = webdriver.Chrome(options=options)
except Exception as e:
print(f"Error creating headless browser: {str(e)}")

def expand_url(url):
try:
Expand Down

0 comments on commit dc8493d

Please sign in to comment.