Skip to content

Commit f5be264

Browse files
committed
fix: trying remote selenium
1 parent 8c9abc3 commit f5be264

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

aio_etsy_stats/main.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ def __init__(self, shop: str, default_reset_hour: int = 14, scrape_interval_minu
5555

5656
# region selenium
5757
if selenium_host and selenium_port:
58+
print("Waiting up 20s for selenium host to be up")
59+
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
60+
test = False
61+
start = datetime.now()
62+
while not test and ((datetime.now() - start) < timedelta(seconds=20)):
63+
connection = sock.connect_ex(('127.0.0.1', 80))
64+
test = connection == 0
65+
sock.close()
66+
5867
self.driver = webdriver.Remote(
5968
command_executor=f"http://{selenium_host}:{selenium_port}/wd/hub",
6069
options=webdriver.ChromeOptions()

0 commit comments

Comments
 (0)