I have a very strange and weird problem with selenium-wire. When I try to use selenium-wire with seleniumbase I am unable to open the page https://courseware.epfl.ch/ when I run the code inside gitlab.
Running the same code locally but with the exact same environment (outside gitlab) does work. It also works for other pages. But not for this specific page inside gitlab.
Asked differently: How can I modify this code below so it works with selenium-wire in order to record the requests being made:
import json
import time
import datetime
from seleniumbase import BaseCase
from seleniumwire import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException, ElementNotVisibleException
class MyTestClass(BaseCase):
def log(self, text):
timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
print(f"{timestamp}: {text}")
def open_page(self, url, filename):
self.log(f"Login: Opening page {url}")
self.open(url)
self.log("Opened page")
time.sleep(10)
self.save_screenshot("debug/" + filename)
def test_base(self):
self.open_page("https://courseware.epfl.ch", "courseware.png")
I have a very strange and weird problem with selenium-wire. When I try to use selenium-wire with seleniumbase I am unable to open the page https://courseware.epfl.ch/ when I run the code inside gitlab.
Running the same code locally but with the exact same environment (outside gitlab) does work. It also works for other pages. But not for this specific page inside gitlab.
Asked differently: How can I modify this code below so it works with selenium-wire in order to record the requests being made: