botasaurus
botasaurus copied to clipboard
Using a remote browser
Hello!
Thank you for this project.
The issue #205 raised the question of using a remote browser, but I was unable to get it to work.
When using
from botasaurus.browser import browser, Driver
@browser(port=45454, host="http://127.0.0.1/")
def scrape_heading_task(driver: Driver, data):
# Visit the Omkar Cloud website
driver.get("https://google.com/", timeout=100)
# Retrieve the heading element's text
heading = driver.get_text("h1")
# Save the data as a JSON file in output/scrape_heading_task.json
return {
"heading": heading
}
# Initiate the web scraping task
scrape_heading_task()
A browser was simply launched on port 45454 (apparently created by botasaurus itself). I attempted to disable this behavior via
@browser(port=45454, host="http://127.0.0.1/", create_driver=lambda: None)
But nothing has changed.
I want to try running it using browserless. Is there any way to disable local browser launch?