Skip to content
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

[Question] Proxy documentation #123

Open
cforcomputer opened this issue Jul 29, 2024 · 8 comments
Open

[Question] Proxy documentation #123

cforcomputer opened this issue Jul 29, 2024 · 8 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed question Further information is requested

Comments

@cforcomputer
Copy link

Describe your question
I've tried getting my proxy service to work with Botright. I have it working with a urllib example and with normal playwright. When I try to convert it to a string and use it in Botright, it does not connect. Can you please add a working example to the Botright documentation?
`botright.modules.proxy_manager.ProxyCheckError: Could not get IP-Address of Proxy (Proxy is Invalid/Timed Out)

import asyncio
import botright


async def main():
    botright_client = await botright.Botright()

    # Proxy configuration
    proxy = "[username]:[password]@[address]:[port]"

    # Launch the browser with proxy settings
    browser = await botright_client.new_browser(
        proxy=proxy,
        args=[
            "--ignore-certificate-errors",
        ],
    )

    # Create a new page and navigate to the desired URL
    page = await browser.new_page()
    await page.goto("https://www.google.com")
    print(await page.title())

    await botright_client.close()


if __name__ == "__main__":
    asyncio.run(main())

Expected behavior
Connects to proxy successfully.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Version 11

Additional context
Adding http:// from the start does not change anything.
Removing args does not change anything

@cforcomputer cforcomputer added documentation Improvements or additions to documentation help wanted Extra attention is needed question Further information is requested labels Jul 29, 2024
@Deswer60871
Copy link

proxy_settings = f'{usernamess}:{passwordss}@{hostname}:{port}'
botright_client = await botright.Botright(
    use_undetected_playwright = True,
    spoof_canvas = False,
    mask_fingerprint = False,
    user_action_layer= True
    )
browser = await botright_client.new_browser(proxy=proxy_settings)
page1 = await browser.new_page()

this working for me

@GJayLG
Copy link

GJayLG commented Aug 4, 2024

i got about:blank proxy not working

@MarioCodarin
Copy link

in hostname:port:username:password format works

@GJayLG
Copy link

GJayLG commented Aug 4, 2024

image

@MarioCodarin
Copy link

please provide minimal working code.

@cuppjj
Copy link

cuppjj commented Nov 9, 2024

anyone find a fix for this. Try to use a proxy and go to google but the page never loads. If I tab and search for it manually everything is working
image_2024-11-09_171647448

@cuppjj
Copy link

cuppjj commented Nov 9, 2024

import asyncio
import botright

async def main():
# Create botright client with specific options
botright_client = await botright.Botright(
use_undetected_playwright=True, # Set this to True if needed
spoof_canvas=False, # Set to False if you don't want spoofing
mask_fingerprint=False, # Set to False if you don't want fingerprint masking
user_action_layer=True # Adjust user action layer behavior as per your needs
)

# Proxy settings
hostname = '1'
port = '1'
username = '1'
password = '1'
proxy_settings = f'{username}:{password}@{hostname}:{port}'

# Launch a new browser with the proxy settings
browser = await botright_client.new_browser(proxy=proxy_settings)

# Create a new page
page = await browser.new_page()

# Navigate to Google
await page.goto("https://google.com")

# Close the botright client when done
await botright_client.close()

if name == "main":
asyncio.run(main())

I tried this with my proxies and it always loads about:blank

@cuppjj
Copy link

cuppjj commented Nov 9, 2024

import asyncio import botright

async def main(): # Create botright client with specific options botright_client = await botright.Botright( use_undetected_playwright=True, # Set this to True if needed spoof_canvas=False, # Set to False if you don't want spoofing mask_fingerprint=False, # Set to False if you don't want fingerprint masking user_action_layer=True # Adjust user action layer behavior as per your needs )

# Proxy settings
hostname = '1'
port = '1'
username = '1'
password = '1'
proxy_settings = f'{username}:{password}@{hostname}:{port}'

# Launch a new browser with the proxy settings
browser = await botright_client.new_browser(proxy=proxy_settings)

# Create a new page
page = await browser.new_page()

# Navigate to Google
await page.goto("https://google.com")

# Close the botright client when done
await botright_client.close()

if name == "main": asyncio.run(main())

I tried this with my proxies and it always loads about:blank

I found a work around for anyone that needs it. If you go to a page that isnt google related like a card and middle mouse click the link the proxy will start to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants