Giter Club home page Giter Club logo

Comments (7)

mdmintz avatar mdmintz commented on June 9, 2024 1

You have to set multi_proxy=True:

multi_proxy=False, # Allow multiple proxies with auth when multi-threaded.

This feature has existed since April 2023 - #1832

Duplicate of #2101 (comment)

from seleniumbase.

mdmintz avatar mdmintz commented on June 9, 2024 1

Set a longer reconnect_time for sb.driver.uc_open_with_reconnect(url, reconnect_time).
Has to be at least as long as the time it takes for the page to finish loading. Eg. examples/raw_pixelscan.py

from seleniumbase.

mobti100 avatar mobti100 commented on June 9, 2024 1

I appreciate your help

from seleniumbase.

mobti100 avatar mobti100 commented on June 9, 2024
Screenshot 2024-03-17 at 02 57 00

I also noticed that the driver uses one single proxy for all instances even though each driver is configured to use a different proxy

from seleniumbase.

mobti100 avatar mobti100 commented on June 9, 2024

Yes, I just fixed it and you replied. Also sometimes the challenge page doesn't let me through and I have to manually click verify, any fix for that.

from seleniumbase.

mobti100 avatar mobti100 commented on June 9, 2024

I noticed when launching multiple instances asynchronously, a conflict occurs in how proxy_ext_dir_n folders are created.
I keep receiving for example proxy_ext_dir_2 already exists because all instances are attempting to create extension folders at the same time. Is there a way that I can custom rename those folder in SB so such conflict does not happen?

def get_cookies(proxy, username, password):
    with SB(uc=True, proxy=proxy, multi_proxy=True) as sb:
        sb.driver.uc_open_with_reconnect('http://example.com/login', 5)
        sb.driver.type('#username', username)
        sb.driver.type('#password', password)
        sb.driver.click('#login')

        return sb.driver.get_cookies()

async def create_session(account, proxy, timeout):
    headers = {
        'User-Agent': ('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) '
                       'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 '
                       'Safari/537.36')
    }
    session = AsyncSession(
        impersonate='chrome119',
        timeout=timeout,
        http_version=CurlHttpVersion.V2_0,
        headers=headers,
        proxies={'https': proxy}
    )

    loop = asyncio.get_running_loop()
    cookies = await loop.run_in_executor(custom_executor, get_cookies, proxy, account['username'], account['password'])
    for cookie in cookies:
        session.cookies.set(cookie['name'], cookie['value'], domain=cookie['domain'])

    return session, account['username'], account['issuer'], account['id'], account['variant']

from seleniumbase.

mdmintz avatar mdmintz commented on June 9, 2024

Multithreaded UC Mode: #2006 (comment)

from seleniumbase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.