Issue with Browserless template

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
Solution:
browserless v2 doesnt support selenium
Jump to solution
13 Replies
Percy
Percy4d ago
Project ID: 11223395-d9b3-48d8-bdf1-5fec7716e393
CallMeFred
CallMeFredOP4d ago
11223395-d9b3-48d8-bdf1-5fec7716e393
Brody
Brody4d ago
browserless v1 or v2?
CallMeFred
CallMeFredOP4d ago
v2 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 it can't reach the endpoint, even if it's properly referenced and printed out if I check it is there a catch with V2?
Solution
Brody
Brody4d ago
browserless v2 doesnt support selenium
CallMeFred
CallMeFredOP4d ago
Ah ok, because I saw in the variables the ones which I thought were for Selenium
No description
CallMeFred
CallMeFredOP4d ago
BROWSER_WEBDRIVER_ENDPOINT
Brody
Brody4d ago
ill remove them, sorry for the confusion
CallMeFred
CallMeFredOP4d ago
so I should just delete this deployment and deploy V1 then?
Brody
Brody4d ago
yep
Brody
Brody4d ago
i can confirm v1 works
No description
CallMeFred
CallMeFredOP4d ago
ok, will do and keep you posted when tested
Want results from more Discord servers?
Add your server