-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[BUG] Overriding Location Problem #1289
Comments
Hello can I have someone help me with this? |
Sorry for the late response! Is it possible to share a more detailed repro script? Looking at the video, scenario is pretty involved and has multiple steps. |
put username and password in for your tinder account const { chromium } = require("playwright");
let username = "";
let password = "";
(async () => {
const browser = await chromium.launch({ headless: false });
const context = await browser.newContext({
geolocation: { longitude: 39.1459143, latitude: -77.0813804 },
permissions: { "https://tinder.com/app/recs": ["geolocation"] },
permissions: { "https://tinder.com/": ["geolocation"] },
args: ["--no-sandbox", "--disable-setuid-sandbox"]
});
const page = await context.newPage();
await page.setViewportSize({ width: 1600, height: 900 });
await page.goto("https://www.tinder.com/");
await page.waitFor(6000);
/*
const moreoptions = await page.$(
'[class="Td(u) Cur(p) Fw($medium) Tt(u)--ml focus-outline-style"]'
);
moreoptions.click();
*/
await page.waitFor(1000);
const facebook = await page.$('[aria-label="Log in with Facebook"]');
await page.waitFor(1000);
await facebook.click();
try {
const newPagePromise = new Promise(x =>
browser.once("targetcreated", target => x(target.page()))
);
const popup = await newPagePromise;
sleep(5000);
console.log(popup.url());
await popup.waitForSelector("#email");
await popup.type("#email", username, {
delay: 60
});
await popup.type("#pass", password, { delay: 60 });
await popup.click("#u_0_0");
await popup.waitFor(5000);
await popup.close();
console.log(page.url());
await page.waitFor(10000);
} catch (e) {
console.log("test");
}
/*
const newPagePromise = new Promise(x =>
browser.once("targetcreated", target => x(target.page()))
);
const popup = await newPagePromise;
sleep(5000);
console.log(popup.url());
await popup.waitForSelector("#email");
await popup.type("#email", "[email protected]", {
delay: 60
});
await popup.type("#pass", "Udoit12@", { delay: 60 });
await popup.click("#u_0_0");
await popup.close();
console.log(page.url());
*/
await page.waitFor(10000);
let a = await page.$('[aria-label="Allow"]');
await a.click();
await page.waitFor(3000);
let b = await page.$('[class="Pos(r) Z(1) Fz($xs) C($c-dark-gray)"]');
await b.click();
let c = await page.$(
'[class="D(b) Mt(24px) W(100%) C($c-secondary) C($c-base):h Fz($s) Cur(p)"]'
);
await c.click();
})();
function sleep(milliseconds) {
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if (new Date().getTime() - start > milliseconds) {
break;
}
}
}
above! |
Thank you for the script, I will look into this issue. |
@dgozman, any further updates on this? I am struggling with similar scenario. |
@ajaykhobragade can you share your script as well? So that I can be sure these are actually related. |
I never get to complete it becoz of other priority tasks but would like to see the solution of an issue above. |
@neilw23 I've played with it, and it looks like there's nothing wrong on Playwright side here. From my investigation, the website is doing its best to prevent automation. To the extend that my tinder profile is no longer operational from web at all =/ I'd speculate that they use services like GeoIP, so just geolocation emulation is far from being enough. I'll close this since there's no issue here as long as Playwright project is concerned. |
Context:
https://www.youtube.com/watch?v=Xm8P2PiPuTs&feature=youtu.be
Code Snippet
const context = await browser.newContext({
geolocation: { longitude: 39.2954, latitude: -76.6239 },
permissions: { "https://tinder.com/app/recs": ["geolocation"] },
permissions: { "https://tinder.com/": ["geolocation"] }
});
Describe the bug
Okay, so I am setting the geolocation and it is allowed on the webpage because usually after you log in to tinder it prompts you to allow your location, but it's continuously searching for matches in the area which means it doesn't know my location
The video is a walkthrough of the problem I'm having
https://www.youtube.com/watch?v=Xm8P2PiPuTs&feature=youtu.be
The text was updated successfully, but these errors were encountered: