Issue with Browserless template
callmefredcom
PROOP

2 years 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

Closed

15 Replies

callmefredcom
PROOP

2 years ago

11223395-d9b3-48d8-bdf1-5fec7716e393


2 years ago

browserless v1 or v2?


callmefredcom
PROOP

2 years ago

v2


callmefredcom
PROOP

2 years ago

This is the start of the function:

def screenshot_url(url, output_path='screenshot.png'):

# Set up Chrome options for headless browsing

chrome_options = Options()

chrome_options.set_capability('browserless:token', os.getenv('BROWSER_TOKEN'))

chrome_options.add_argument("--window-size=1920,1080")

chrome_options.add_argument("--disable-background-timer-throttling")

chrome_options.add_argument("--disable-backgrounding-occluded-windows")

chrome_options.add_argument("--disable-breakpad")

chrome_options.add_argument("--disable-component-extensions-with-background-pages")

chrome_options.add_argument("--disable-dev-shm-usage")

chrome_options.add_argument("--disable-extensions")

chrome_options.add_argument("--disable-features=TranslateUI,BlinkGenPropertyTrees")

chrome_options.add_argument("--disable-ipc-flooding-protection")

chrome_options.add_argument("--disable-renderer-backgrounding")

chrome_options.add_argument("--enable-features=NetworkService,NetworkServiceInProcess")

chrome_options.add_argument("--force-color-profile=srgb")

chrome_options.add_argument("--hide-scrollbars")

chrome_options.add_argument("--metrics-recording-only")

chrome_options.add_argument("--mute-audio")

chrome_options.add_argument("--headless")

chrome_options.add_argument("--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

2 years ago

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


callmefredcom
PROOP

2 years ago

is there a catch with V2?


2 years ago

browserless v2 doesnt support selenium


callmefredcom
PROOP

2 years ago

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

1306712462032371762


callmefredcom
PROOP

2 years ago

BROWSER_WEBDRIVER_ENDPOINT


2 years ago

ill remove them, sorry for the confusion


callmefredcom
PROOP

2 years ago

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


2 years ago

yep


2 years ago

i can confirm v1 works

1306712772863721492


callmefredcom
PROOP

2 years ago

ok, will do and keep you posted when tested


2 years ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...