Closed
Description
So the issue with the same following (chopped) code didn't occur in GUI mode. With --headless
arg, Google Chrome instance could take up to 10GiB of ram. Hasn't anyone encountered the same? or is there anything wrong with my code? Thank you, very appreciated.
from collections import deque
from datetime import datetime, timedelta
import argparse
import csv
import os
import logging
import random
import signal
import socket
import sys
import time
import datetime
import threading
import requests
import tracemalloc
import pandas as pd
import paramiko
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException,ElementNotInteractableException
from seleniumbase import BaseCase
from seleniumbase import MasterQA
from jinja2 import Environment, FileSystemLoader
[some code here]
class AmazonFlow(BaseCase):
[some code here]
def test_amazon_flow(self):
try:
# Set Amazon and check location
self.set_amazon()
while not self.check_location():
self.set_amazon()
# start the heartbeat thread
# heartbeat_thread.start()
# Continue with price checking indefinitely
while True:
# Only proceed if check_prices returns True
self.check_prices()
time.sleep(10)
# convert CSV to nice-looking HTML after checking prices
csv_to_bootstrap_html('price.csv', 'price.html','template.html')
# upload the generated HTML to the server
upload_file_via_ssh()
except KeyboardInterrupt:
print("Interrupted by user")
except Exception as e:
print(f"An error occurred: {e}")
finally:
self.tearDown()
if __name__ == "__main__":
BaseCase.main(__name__, __file__,"--uc","--incognito")