I am trying to use Selenium in Java to get the user's geographical coordinates, but using IP address isn't accurate enough, so i wanted to use this website http://www.whataremycoordinates.com/ , but it isn't working, and I am guessing it is because you have to allow location use, so is there anyway I can allow location use in Selenium, or maybe some other way to get exact geographical coordinates
Usually, when a site wants to get this kind of data, a browser asks you if you want to share your location. The question is inside a popup which cannot be controlled with selenium
. In this case, you need to tell the browser, not to open the popup and allow to share your location at the same time so that the popup would not be opened in the first place.
For Firefox
, you need to:
about:permissions
to see the setting)FirefoxProfile
pointing to the profile you've saved beforeFor more information, see:
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句