coskundeniz/ad_clicker

Bought a proxy for a a specific country, but when I run the script it opens Google Chrome localized in a different country

sipy opened this issue · 7 comments

sipy commented

Hello,
I bought a static proxy for a a specific country, but when I run the script it opens Google Chrome localized in a different country. Why does it happen if I am 100% sure that the IP is located in the country and city i need it to be in?

Thanks

It shouldn't. It sets the geolocation and the timezone according to the proxy country. You can reserve a slot for free to check together.

sipy commented

Yes, thank you.

sipy commented

Hi @coskundeniz , is it possibile to hardcode the geolocalization of the generated chrome browser instance? In my case it would be enough simply hardcode the location. This will solve my specific problem

Thanks

Yes, you can try changing the following parts in utils.py file.

    ```
    # lat, long = get_location(geolocation_db_client, proxy, auth) --> commented

    if lat and long:  --> remove this line, unindent the code below, and replace <> parts with your values 
        driver.execute_cdp_cmd(
            "Emulation.setGeolocationOverride",
            {"latitude": <your latitude>, "longitude": <your longitude>, "accuracy": accuracy},
        )

        response = requests.get(
            f"http://timezonefinder.michelfe.it/api/0_{<your longitude>}_{<your latitude>}", timeout=5
        )
sipy commented

Ok, I made the changes you suggested, but it still localizes the wrong country. Romania instead of Bulgaria. Here is the code:

image

Also, remove the parenthesis here but it won't change the result anyway.
f"http://timezonefinder.michelfe.it/api/0_{<your longitude>}_{<your latitude>}", timeout=5

I don't have an idea why it happens.

Closing since there is no obvious thing to do on the tool side.