ref(YandexMap): add initial_coordinates
This commit is contained in:
@@ -12,15 +12,23 @@ from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.common.action_chains import ActionChains
|
||||
|
||||
def generateURL(lat=49.103814, lon=55.794258, zoom=10):
|
||||
def generateURL(lat: float, lon: float, zoom: int):
|
||||
return f"https://yandex.ru/maps/43/kazan/?l=sat&ll={lat}%2C{lon}&z={zoom}"
|
||||
|
||||
class YandexMap:
|
||||
def __init__(self):
|
||||
initial_zoom: int
|
||||
initial_lat: float
|
||||
initial_lon: float
|
||||
|
||||
def __init__(self, initial_lat=49.103814, initial_lon=55.794258, initial_zoom=10):
|
||||
self.initial_lat = initial_lat
|
||||
self.initial_lon = initial_lon
|
||||
self.initial_zoom = initial_zoom
|
||||
|
||||
options = webdriver.ChromeOptions()
|
||||
# options.add_experimental_option("detach", True)
|
||||
self.driver = webdriver.Chrome(options)
|
||||
self.driver.get(generateURL())
|
||||
self.driver.get(generateURL(initial_lat, initial_lon, initial_zoom))
|
||||
self.driver.maximize_window()
|
||||
sleep(2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user