Skip to content

Use custom port instead of botasaurus assigned free port #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jfzlma opened this issue Dec 10, 2024 · 1 comment
Closed

Use custom port instead of botasaurus assigned free port #211

jfzlma opened this issue Dec 10, 2024 · 1 comment

Comments

@jfzlma
Copy link

jfzlma commented Dec 10, 2024

I see that the ports are currently assigned randomly, using any free port. It would be helpful if there were a provision to use custom ports, as this would assist in better management of firewalls.

@Chetan11-dev
Copy link
Contributor

Added,

  1. do
    python -m pip install bota botasaurus botasaurus-api botasaurus-requests botasaurus-driver bota botasaurus-proxy-authentication botasaurus-server --upgrade

  2. test with

from botasaurus.browser import browser, Driver

@browser(port=45454)
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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants