Issue with Browserless template
callmefredcom
PROOP

a year 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

15 Replies

callmefredcom
PROOP

a year ago

11223395-d9b3-48d8-bdf1-5fec7716e393


a year ago

browserless v1 or v2?


callmefredcom
PROOP

a year ago

v2


callmefredcom
PROOP

a year ago

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

callmefredcom
PROOP

a year ago

it can't reach the endpoint, even if it's properly referenced and printed out if I check it


callmefredcom
PROOP

a year ago

is there a catch with V2?


a year ago

browserless v2 doesnt support selenium


callmefredcom
PROOP

a year ago

Ah ok, because I saw in the variables the ones which I thought were for Selenium

1306712462032371700


callmefredcom
PROOP

a year ago

BROWSERWEBDRIVERENDPOINT


a year ago

ill remove them, sorry for the confusion


callmefredcom
PROOP

a year ago

so I should just delete this deployment and deploy V1 then?


a year ago

yep


a year ago

i can confirm v1 works

1306712772863721500


callmefredcom
PROOP

a year ago

ok, will do and keep you posted when tested


a year ago


Loading...