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
15 Replies
2 years ago
browserless v1 or 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}")
returnit can't reach the endpoint, even if it's properly referenced and printed out if I check it
2 years ago
browserless v2 doesnt support selenium
Ah ok, because I saw in the variables the ones which I thought were for Selenium

2 years ago
ill remove them, sorry for the confusion
2 years ago
yep
2 years ago
i can confirm v1 works

2 years ago