7 months ago
Hi, maybe you can help me. I have set up in a project the Browserless template but each time I try to run a simple Selenium screenshot capture function,
I get this error even if my variables are properly configured in my web app (in the same project):
browserless.io:server:trace Handling inbound HTTP request on "POST: /webdriver/session" +9m
browserless.io:server:error No matching HTTP route handler for "POST: http://0.0.0.0:8080/webdriver/session?launch=%7B%7D"; +9m
I'm using the internal endpoint: http://browserless.railway.internal:3001/webdriver
0 Replies
7 months ago
browserless v1 or v2?
This is the start of the function:
def screenshoturl(url, outputpath='screenshot.png'):
# Set up Chrome options for headless browsing
chromeoptions = Options() chromeoptions.setcapability('browserless:token', os.getenv('BROWSERTOKEN'))
chromeoptions.addargument("--window-size=1920,1080")
chromeoptions.addargument("--disable-background-timer-throttling")
chromeoptions.addargument("--disable-backgrounding-occluded-windows")
chromeoptions.addargument("--disable-breakpad")
chromeoptions.addargument("--disable-component-extensions-with-background-pages")
chromeoptions.addargument("--disable-dev-shm-usage")
chromeoptions.addargument("--disable-extensions")
chromeoptions.addargument("--disable-features=TranslateUI,BlinkGenPropertyTrees")
chromeoptions.addargument("--disable-ipc-flooding-protection")
chromeoptions.addargument("--disable-renderer-backgrounding")
chromeoptions.addargument("--enable-features=NetworkService,NetworkServiceInProcess")
chromeoptions.addargument("--force-color-profile=srgb")
chromeoptions.addargument("--hide-scrollbars")
chromeoptions.addargument("--metrics-recording-only")
chromeoptions.addargument("--mute-audio")
chromeoptions.addargument("--headless")
chromeoptions.addargument("--no-sandbox")
# Initialize the browser
try:
driver = webdriver.Remote(
command_executor=os.getenv('BROWSER_WEBDRIVER_ENDPOINT'),
options=chrome_options
)
except Exception as e:
print(f"Error initializing WebDriver: {e}")
return
it can't reach the endpoint, even if it's properly referenced and printed out if I check it
7 months ago
browserless v2 doesnt support selenium
Ah ok, because I saw in the variables the ones which I thought were for Selenium
7 months ago
ill remove them, sorry for the confusion
7 months ago
yep
7 months ago
i can confirm v1 works
7 months ago