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
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
13 Replies
Project ID:
11223395-d9b3-48d8-bdf1-5fec7716e393
11223395-d9b3-48d8-bdf1-5fec7716e393
browserless v1 or v2?
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
browserless v2 doesnt support selenium
Ah ok, because I saw in the variables the ones which I thought were for Selenium
BROWSER_WEBDRIVER_ENDPOINT
ill remove them, sorry for the confusion
so I should just delete this deployment and deploy V1 then?
yep
i can confirm v1 works
ok, will do and keep you posted when tested