import time
# ## Launching Chrome Browser
# from selenium import webdriver
# chrome_driver = [Link]()
#
# ## The above code will close the browser automatically
#
# ##-------------------------------------------------------------------
# ## To prevent the browser from automatically closing, use the below code
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option("detach", True)
#
# chrome_driver = [Link](options=opts)
###########################################################################
####################
# ## Launching Firefox browser
# from selenium import webdriver
# firefox_driver = [Link]()
#
# ## Firefox browser will not close automatically.
# ## So no need to consider the FirefoxOptions
###########################################################################
####################
# ## Launching Edge browser
# from selenium import webdriver
# edge_driver = [Link]()
#
# ## The above code will close the browser automatically
#
# ##-------------------------------------------------------------------
# ## To prevent the browser from automatically closing, use the below code
#
# from selenium import webdriver #
# opts = [Link]()
# opts.add_experimental_option("detach", True) #
# chrome_driver = [Link](options=opts)
###########################################################################
####################
from selenium import
webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
## Launch the web-application
[Link]("[Link] [Link](2)
## To maximize the browser driver.maximize_window()
[Link](2)
# ## To minimize the browser
# driver.minimize_window()
## To go back [Link]()
[Link](2)
## To go forward [Link]()
## To refresh
[Link]() ##
## name : This is a property. It will give the name of the browser
print([Link])
## current_url : This is a property. It will give the current url
print(driver.current_url)
## title : This is a property. It will give the title of the page
print([Link])
## To get the screenshot
driver.save_screenshot("myntra_ss.png")
## To save the screenshot in different location
driver.save_screenshot(r"C:\Users\Ramya\PycharmProjects\Sel-M11-
March3\files\ss_myntra.png")
## close the browser [Link]()
################################№################################
Import time
# ## Launching Chrome Browser
# from selenium import webdriver
# chrome_driver = [Link]()
#
# ## The above code will close the browser automatically
#
# ##-------------------------------------------------------------------
# ## To prevent the browser from automatically closing, use the below code
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# chrome_driver = [Link](options=opts)
# ## Launching Firefox browser
# from selenium import webdriver
# firefox_driver = [Link]()
#
# ## Firefox browser will not close automatically.
# ## So no need to consider the FirefoxOptions
# ## Launching Edge browser
# from selenium import webdriver
# edge_driver = [Link]()
#
# ## The above code will close the browser automatically
#
# ##-------------------------------------------------------------------
# ## To prevent the browser from automatically closing, use the below code
#
# from selenium import webdriver #
# opts = [Link]()
# opts.add_experimental_option(“detach”, True) #
# chrome_driver = [Link](options=opts)
From selenium import webdriver
Opts = [Link]()
Opts.add_experimental_option(“detach”, True)
Driver = [Link](options=opts)
## Launch the web-application
[Link]([Link]
[Link](2)
## To maximize the browser
Driver.maximize_window()
[Link](2)
# ## To minimize the browser
# driver.minimize_window()
## To go back
[Link]()
[Link](2)
## To go forward
[Link]()
## To refresh
[Link]()
##
## name : This is a property. It will give the name of the browser
Print([Link])
## current_url : This is a property. It will give the current url
Print(driver.current_url)
## title : This is a property. It will give the title of the page
Print([Link])
## To get the screenshot
Driver.save_screenshot(“myntra_ss.png”)
## To save the screenshot in different location
Driver.save_screenshot(r”C:\Users\Ramya\PycharmProjects\Sel-M11-
March3\files\ss_myntra.png”)
## close the browser
[Link]()
##############################£######£#####################################
2######################################
‘’’
Id : If we are having id attribute, then we can go for id locator
‘’’
Import time
From selenium import webdriver
Opts = [Link]()
Opts.add_experimental_option(“detach”, True)
Driver = [Link](options=opts)
[Link]([Link]
[Link](2)
Driver.find_element(“id”, “user-name”).send_keys(“standard_user”)
[Link](1)
Driver.find_element(“id”, “password”).send_keys(“secret_sauce”)
[Link](1)
Driver.find_element(“id”, “login-button”).click()
[Link](3)
Driver.find_element(“id”, “react-burger-menu-btn”).click()
[Link](2)
Driver.find_element(“id”, “logout_sidebar_link”).click()
#######################£££###£####################£@£@@£@£@£@£@£@£@£@£@@£@@
£@3@_#__@@@£@£@£@£@@£@£@£@£@£@£@£@@£@£@
‘’’
Class name : If we are having class attribute, we can go for “class
name” locator
DRAWBACKS
• Class name locator cannot recognize the spaces. So
if we have space in the class value, we have to
replace the space with dot(.)
* class name is not unique
* If we are having multiple occurances, class name will always consider the
first occurance
‘’’
Impor
t
time
# ## Eg1
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True) #
# driver = [Link](options=opts)
#
# [Link]([Link]
# [Link](2)
# driver.find_element(“class name”, “ico-register”).click()
# [Link](2)
# driver.find_element(“class name”, “ico-login”).click()
# [Link](2)
# driver.find_element(“class name”, “ico-cart”).click()
# ## Eg2
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link]([Link]
# [Link](2)
#
# driver.find_element(“class name”, “_aa4b _add6 _ac4d
_ap35”).send_keys(“Virat”)
#
# ## NoSuchElementException
# ## Class name locator cannot recognize the spaces. That’s why we are
getting Error
#
# ##-----------------------------------------------------------------------
---------------------
#
# ## To overcome this Error, We have to replace the spaces with dot
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link]([Link]
# [Link](2)
#
# driver.find_element(“class name”,
“_aa4b._add6._ac4d._ap35”).send_keys(“Virat”)
## Eg3
From selenium import webdriver
Opts = [Link]()
Opts.add_experimental_option(“detach”, True)
Driver = [Link](options=opts)
[Link]([Link]
[Link](2)
Driver.find_element(“class name”,
“_aa4b._add6._ac4d._ap35”).send_keys(“Virat”)
[Link](1)
Driver.find_element(“class name”,
“_aa4b._add6._ac4d._ap35”).send_keys(“virat@12345”)
## Both username and password will be filled in the username textbox only
## Because, incase of multiple occurances, class name locator will always
consider the first occurance
##@######£@££@@£@£@£@@£@_£@£@£@£@@@£@£@@£@£@£@@£@@@@@@@@@@£@£@£@£@££@£@£@£@
£@£@£@££@@£@£@£@@££@$€$£££@£$€$£$£@£@@£
'''
name : If we are having name attribute, we can go for name locator
''' import time ## Eg1
from selenium import
webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]("[Link]
[Link](2)
driver.find_element("name",
"username").send_keys("virat_kohli") [Link](1)
driver.find_element("name", "password").send_keys("virat@12345")
########################################################################
## Eg2
from selenium import webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]("[Link]
[Link](2) driver.find_element("name",
"firstname").send_keys("Light") [Link](1)
driver.find_element("name", "lastname").send_keys("Yagami")
[Link](1) driver.find_element("name",
"reg_email__").send_keys("light@[Link]") [Link](1)
driver.find_element("name", "reg_passwd__").send_keys("light@12345")
'''
tagname : We can locate the elements using tagname, but tagname will
always consider the first occurance
''' import time
from selenium import
webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]("[Link]
[Link](2)
driver.find_element('tag name',
'input').send_keys('standard_user') [Link](1)
driver.find_element('tag name', 'input').send_keys('secret_sauce')
‘’’
Link text : The text present between the anchor tag(<a> text </a>), we
call it as link text.
We can locate the web-elements using the link text
‘’’
Import time
# ## Eg1
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link]([Link]
# [Link](2)
#
# driver.find_element(‘link text’, ‘Home & Living’).click()
# [Link](2)
# driver.find_element(‘link text’, ‘Kids’).click()
# [Link](2)
# driver.find_element(‘link text’, ‘Beauty’).click()
# ## Eg2
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link](‘[Link]
# [Link](2)
# driver.find_element(‘link text’, ‘Register’).click()
# [Link](2)
# driver.find_element(‘link text’, ‘Log in’).click()
'''
partial link text : Same as link text. Here also the text should be
present between the anchor tag.
Instead of locating the complete text, we can
locate it partially using partial link text locator
''' import time from
selenium import webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]('[Link] [Link](2)
driver.find_element('partial link text', 'Reg').click()
[Link](2) driver.find_element('partial link text',
'Log').click()
###########################################################################
########
from selenium import webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]('[Link] [Link](2)
driver.find_element('partial link text', 'Books').click() [Link](2)
driver.find_element('partial link text', 'Computers').click() [Link](2)
driver.find_element('partial link text', 'Electronics').click()
################################################################
########### #######
from selenium import webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]("[Link]
[Link](2)
driver.find_element('partial link text', 'Home &').click()
[Link](2) driver.find_element('partial link text', 'Kid').click()
[Link](2) driver.find_element('partial link text', 'Beau').click()
'''
css selector : To locate the web-elements using any attributes we go
for css selector.
SYNTAX : tagname[attr_name="attr_value"]
DRAWBACKS
* Indexing is not possible.
If we are having multiple occurances, css selector
will always consider the first occurance * Cannot
locate text
* Backtraversing is not possible
''' import time ## Eg1
from selenium import
webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]('[Link]
[Link](2)
driver.find_element('css
selector',
'input[placeholder="Username"]').send_keys('standard_user') [Link](1)
driver.find_element('css selector',
'input[type="password"]').send_keys('secret_sauce') [Link](1)
driver.find_element('css selector', 'input[value="Login"]').click()
[Link](3)
driver.find_element('css selector', 'button[id="react-burger-
menubtn"]').click() [Link](2)
driver.find_element('css selector', 'a[id="logout_sidebar_link"]').click()
###########################################################################
######## ## Eg2
from selenium import webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]('[Link] [Link](2)
driver.find_element('css selector', 'input[aria-label="Phone number,
username, or email"]').send_keys('harry_potter') [Link](2)
driver.find_element('css selector',
'input[arialabel="Password"]').send_keys('harry@123456')
###########################################################################
######## ##
Eg3
from selenium import webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]('[Link]
[Link](2)
driver.find_element('css selector',
'input[id="name"]').send_keys('harry
potter') [Link](1)
driver.find_element('css selector', 'input[placeholder="Enter
EMail"]').send_keys('harry@[Link]') [Link](1)
driver.find_element('css selector',
'input[id="phone"]').send_keys('9807605754') [Link](1)
driver.find_element('css selector',
'textarea[id="textarea"]').send_keys('hogwarts')
###########################################################################
########
# ## Eg4
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option("detach", True)
#
# driver = [Link](options=opts) #
# [Link]("[Link]
# [Link](2)
#
# driver.find_element('css selector',
'input[type="text"]').send_keys('harry potter')
# [Link](1)
# driver.find_element('css selector',
'input[type="text"]').send_keys('harry@[Link]')
#
# ## Data will be filled in name textbox only
# ## Incase of multiple occurances, css selector will always consider the
first occurance
###########################################################################
#######
UserName:
Password:
'''
xpath : It is a locator to locate any element on the web-application
uniquely
There are 2 types of xpath
* absolute xpath : Starts from the root of html
We use / to represent the immediate child *
relative xpath :
''' import
time
# ## Eg1
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option("detach", True)
#
# driver = [Link](options=opts)
#
# [Link](r'C:\Users\Ramya\PycharmProjects\Sel-M11-
March3\files\css_selector_dup.html')
# [Link](2)
# driver.find_element('xpath', 'html/body/input[1]').send_keys('Ram')
# [Link](1)
# driver.find_element('xpath', 'html/body/input[2]').send_keys('ram@12345')
###########################################################################
#####
#
# ## Eg2
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option("detach", True)
#
# driver = [Link](options=opts)
#
# [Link]("[Link]
# [Link](2)
#
# driver.find_element('xpath',
'html/body/div/div/div[2]/div[1]/div/div/form/div[1]/input').send_keys('sta
ndard_user') # [Link](1)
# driver.find_element('xpath',
'html/body/div/div/div[2]/div[1]/div/div/form/div[2]/input').send_keys('sec
ret_sauce')
###########################################################################
##### '''
attribute name and value : //tagname[@attr_name="attr_value"]
// represents anychild
@ represents attribute
'''
# ## Eg1
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option("detach", True)
#
# driver = [Link](options=opts)
#
# [Link]("[Link]
# [Link](2)
#
# driver.find_element('xpath',
'//input[@placeholder="Username"]').send_keys('standard_user')
# [Link](1)
# driver.find_element('xpath',
'//input[@type="password"]').send_keys('secret_sauce')
# [Link](1)
# driver.find_element('xpath', '//input[@name="login-button"]').click()
# [Link](2)
# driver.find_element('xpath', '//button[@id="react-
burgermenubtn"]').click() # [Link](2)
# driver.find_element('xpath', '//a[@id="logout_sidebar_link"]').click()
###########################################################################
######################
# ## Eg2
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option("detach", True)
#
# driver = [Link](options=opts)
#
# [Link]('[Link] #
[Link](2)
# driver.find_element('xpath',
'//input[@name="firstname"]').send_keys('Sudha')
# [Link](1)
# driver.find_element('xpath',
'//input[@name="lastname"]').send_keys('Murthy')
# [Link](1)
# driver.find_element('xpath', '//input[@value="1"]').click()
# [Link](1)
# driver.find_element('xpath',
'//input[@name="reg_email__"]').send_keys('sudha@[Link]')
# [Link](1)
# driver.find_element('xpath',
'//input[@type="password"]').send_keys('sudha@12345')
#
#
###########################################################################
######################
# ## Eg3
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option("detach", True)
#
# driver = [Link](options=opts)
#
# [Link]('[Link]
# [Link](2)
# driver.find_element('xpath', '//a[@data-group="men"]').click()
# [Link](1)
# driver.find_element('xpath', '//a[@data-group="home-&-living"]').click()
# [Link](1)
# driver.find_element('xpath', '//a[@data-group="beauty"]').click()
###########################################################################
#############
# ## Eg4
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option("detach", True)
#
# driver = [Link](options=opts)
#
# [Link]('[Link]
# [Link](2)
# driver.find_element('xpath',
'//input[@placeholder="Search"]').send_keys('shaitaan')
# [Link](2)
# driver.find_element('xpath', '//button[@title="Search"]').click()
# [Link](3)
# driver.find_element('xpath', '//a[@title="Shaitaan | Official Trailer |
Ajay Devgan, R Madhavan | Netflix India"]').click()
###########################################################################
############
'''
ASSIGNMENTS for xpath
1. Go to [Link] click on register and fill the
register details
2. Go to [Link] give the credentials and try to login
3. Go to [Link] give the credentials and try to login
'''
#####
#####
#####
#####
#####
#####
#####
#####
#####
#####
#####
#####
#####
#####
#####
######################
'''
Using text : //tagname[text()="text"]
'''
from selenium import webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]('[Link]
[Link](2)
driver.find_element('xpath', '//a[text()="Men"]').click()
[Link](2) driver.find_element('xpath', '//a[text()="Home &
Living"]').click()
[Link](2)
driver.find_element('xpath', '//a[text()="Beauty"]').click()
###########################################################################
####### ##
Eg2
from selenium import webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]('[Link] [Link](2)
driver.find_element('xpath', '//span[text()="KIDS"]').click() [Link](2)
driver.find_element('xpath', '//span[text()="Home & Kitchen"]').click()
###########################################################################
######
#
## Eg3
from selenium import webdriver
opts =
[Link]()
opts.add_experimental_option("detach", True)
driver =
[Link](options=opts)
[Link]('[Link]
[Link](2) driver.find_element('xpath',
'//span[text()="Appliances"]').click() [Link](2)
driver.find_element('xpath', '//a[text()="Flights"]').click()
##########################################################################
################№#########################################################
######
## text
Import time
# ## eg1
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link](‘[Link]
# [Link](2)
# home_living = driver.find_element(‘xpath’, ‘//a[@data-group=”home-
&living”]’)
# print(home_living.text)
# beauty = driver.find_element(‘xpath’, ‘//a[@data-group=”beauty”]’)
# print([Link])
From selenium import webdriver
Opts = [Link]()
Opts.add_experimental_option(“detach”, True)
Driver = [Link](options=opts)
[Link](‘[Link]
[Link](2)
Beauty = driver.find_element(‘xpath’, ‘//a[text()=”Beauty”]’)
Print(beauty.get_attribute(“href”))
Print(beauty.get_attribute(“data-color”))
№#########################################₹#₹₹₹₹₹₹₹₹₹₹####################
##########################################################################
#######
‘’’
Find_elements : To locate and to interact with multiple occurances, we
go for find_elements.
The return type of find_elements is list of webelements
‘’’
Import time
# ## Eg1. Wap to print all the elements present in the footer
of [Link]
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link](‘[Link] #
[Link](2)
# footer_elements = driver.find_elements(‘xpath’,
‘//div[@class=”footermenu-wrapper”]//a’)
# # print(footer_elements) ## list of web-elements ## [wb1, wb2,
wb3, wb4, wb5, wb6, wb7, wb8, wb9,.....wb22]
#
# for ele in footer_elements:
# print([Link])
#
#
#
##########################################################################
#####################
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link](‘[Link]
# [Link](2)
# category_elements = driver.find_elements(‘xpath’, ‘//div[@class=”block
block-category-navigation”]//a’)
# # print(category_elements) ## list of webelements ##
[wb1, wb2, wb3, wb4, wb5, wb6, wb7]
#
# for ele in category_elements:
# print([Link])
#
#
##########################################################################
#####################
# ## Eg3
# ## wap to print all the popular searches in
[Link]
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link](‘[Link]
# [Link](2)
# popular_searches = driver.find_elements(‘xpath’,
‘//div[@class=”desktoppSearchlinks”]/a’)
# # print(popular_searches) ##list of web-elements
#
# for ele in popular_searches:
# print([Link])
##################################################################₹₹₹₹₹₹₹₹
₹₹₹₹₹_₹₹######₹₹₹#########################################################
######
‘’’
Find_elements : To locate and to interact with multiple occurances, we
go for find_elements.
The return type of find_elements is list of webelements
‘’’
Import time
# ## Eg1. Wap to print all the elements present in the footer
of [Link]
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link](‘[Link]
# [Link](2)
# footer_elements = driver.find_elements(‘xpath’,
‘//div[@class=”footermenu-wrapper”]//a’)
# # print(footer_elements) ## list of web-elements ## [wb1, wb2,
wb3, wb4, wb5, wb6, wb7, wb8, wb9,.....wb22]
#
# for ele in footer_elements:
# print([Link])
#
#
#
##########################################################################
#####################
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link](‘[Link]
# [Link](2)
# category_elements = driver.find_elements(‘xpath’, ‘//div[@class=”block
block-category-navigation”]//a’)
# # print(category_elements) ## list of webelements ##
[wb1, wb2, wb3, wb4, wb5, wb6, wb7]
#
# for ele in category_elements:
# print([Link])
#
#
##########################################################################
#####################
# ## Eg3
# ## wap to print all the popular searches in
[Link]
#
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link](‘[Link]
# [Link](2)
# popular_searches = driver.find_elements(‘xpath’,
‘//div[@class=”desktoppSearchlinks”]/a’)
# # print(popular_searches) ##list of web-elements
#
# for ele in popular_searches:
# print([Link])
## text
import time
# ## eg1
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option("detach", True)
#
# driver = [Link](options=opts)
#
# [Link]('[Link]
# [Link](2)
# home_living = driver.find_element('xpath', '//a[@data-group="home-
&living"]')
# print(home_living.text)
# beauty = driver.find_element('xpath', '//a[@data-group="beauty"]')
# print([Link])
##########################################################################
####
from selenium import webdriver
opts = [Link]()
opts.add_experimental_option("detach", True)
driver = [Link](options=opts)
[Link]('[Link] [Link](2)
beauty = driver.find_element('xpath', '//a[text()="Beauty"]')
print(beauty.get_attribute("href")) print(beauty.get_attribute("data-
color"))
######№#####################################################################
############################################################################
##### [Link]#########
Import time
# from selenium import webdriver
#
# opts = [Link]()
# opts.add_experimental_option(“detach”, True)
#
# driver = [Link](options=opts)
#
# [Link](‘[Link]
# driver.maximize_window()
# [Link](2)
#
# driver.find_element(‘xpath’,
‘//span[@class=”commonModal__close”]’).click()
# [Link](2)
#
# driver.find_element(‘xpath’, ‘//span[text()=”Departure”]’).click()
# [Link](2)
#
# while True:
# month = driver.find_element(‘xpath’, ‘(//div[@class=”DayPicker-
Caption”])[1]’)
# print([Link])
#
# if [Link] ==’October 2025’:
# driver.find_element(‘xpath’, ‘(//p[text()=”10”])[1]’).click()
# break
# else:
# driver.find_element(‘xpath’, ‘//span[@aria-label=”Next
Month”]’).click()
From selenium import webdriver
Opts = [Link]()
Opts.add_experimental_option(“detach”, True)
Driver = [Link](options=opts)
[Link](‘[Link]
Driver.maximize_window()
[Link](2)
Driver.find_element(‘xpath’, ‘//span[@class=”commonModal__close”]’).click()
[Link](2)
Driver.find_element(‘xpath’, ‘//span[text()=”Departure”]’).click()
[Link](2)
While True:
Try:
Driver.find_element(‘xpath’, ‘//div[text()=”October
2025”]/../..//p[text()=”10”]’).click()
Break
Except:
Driver.find_element(‘xpath’, ‘//span[@aria-label=”Next
Month”]’).click()