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

geolocation detection #164

Open
Diegoadg96 opened this issue Jan 24, 2025 · 0 comments
Open

geolocation detection #164

Diegoadg96 opened this issue Jan 24, 2025 · 0 comments
Labels
detection-issue Potential leak in Camoufox.

Comments

@Diegoadg96
Copy link

Website detecting Camoufox:

I'm trying to use camoufox to get to the page but it always takes me to the login, I used a residential proxy for the site and also the command geoip=True, but it still always takes me to the login.

I have also tried to do tests with the login and storing the cookies, everything works fine, but when I use the cookie in the Google login it asks me for a double factor, something that does not happen with the proxy disabled.

Screenshots:

To Reproduce:

async def main():
session_file = 'session.dat'
async with AsyncCamoufox(headless=False,
humanize=True,
block_images=False,

geoip=True,

proxy={

'server': '...:20000',

'username': '*',

'password': '*k'

},

                         block_webrtc=True) as browser:
    if os.path.exists(session_file):
        context = await browser.new_context(storage_state=session_file)
    else:
        context = await browser.new_context()

    page = await context.new_page()
    
    await page.goto('https://shopee.com.br/shopee-product-i.412846697.12226549627', wait_until="networkidle")

    if not os.path.exists(session_file):
        await page.wait_for_selector('input[name="loginKey"]')

        async with page.expect_popup() as popup_info:
            await page.click('button[aria-label="Entrar com Google"]')
                
            
        popup_page = await popup_info.value

        await popup_page.wait_for_selector('input[type="email"]')
            
        await popup_page.fill('input[type="email"]', '****')

        await popup_page.click('button[jsname="LgbsSe"]:visible')  

        await popup_page.wait_for_selector('input[type="password"]')

        await popup_page.fill('input[type="password"]', '****')

        await popup_page.click('button[jsname="LgbsSe"]:visible')

        await page.wait_for_timeout(10000)
            
        await popup_page.wait_for_selector('button[jsname="LgbsSe"]:visible')
        buttons = await popup_page.query_selector_all('button[jsname="LgbsSe"]:visible')

        if len(buttons) > 1:
                await buttons[1].click() 
        else:
                print("No se encontró el segundo botón")

        await page.wait_for_timeout(10000)  
        await page.wait_for_selector('input.shopee-searchbar-input__input')

        await context.storage_state(path='session.dat')
        
    async with page.expect_response('https://shopee.com.br/api/v4/pdp/get_pc') as response_info:
        await page.wait_for_timeout(10000)  
        response = await response_info.value
        response_body = await response.json()
        print(response_body)

    page_html = await page.content()

    with open('pagina.html', 'w', encoding='utf-8') as file:
        file.write(page_html)

    await context.close()
    await browser.close()
    print("Closed Browser")

asyncio.run(main())`

Other questions:

These questions will help me diagnose the issue:

  1. Are you using a proxy?

Oxylabs residencial brasil y massive residencial brasil

  1. Open the website in a private tab in your personal browser using the same IP. Does it work?

yes it works

  1. Is Camoufox detected randomly or every time?

Always

  1. What OS are you using?
    macos

Version:

Pip package: v0.4.9
Camoufox: v133.0-beta.19 (Up to date!)

@Diegoadg96 Diegoadg96 added the detection-issue Potential leak in Camoufox. label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detection-issue Potential leak in Camoufox.
Projects
None yet
Development

No branches or pull requests

1 participant