-
Notifications
You must be signed in to change notification settings - Fork 803
Open
Description
i was trying this code in bms automation
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import time
# Setup Chrome options
chrome_options = Options()
chrome_options.add_argument("--start-maximized")
# Path to your ChromeDriver
chrome_driver_path = "path/to/chromedriver"
# Initialize the Chrome WebDriver
service = Service(chrome_driver_path)
driver = webdriver.Chrome(service=service, options=chrome_options)
# Go to BookMyShow website
driver.get('https://in.bookmyshow.com')
# Wait for page to load
time.sleep(5)
# Select location (change "Hyderabad" if necessary)
location = driver.find_element(By.CLASS_NAME, 'sc-jTzLTM') # Find the location drop-down
location.click()
search_box = driver.find_element(By.CLASS_NAME, 'sc-gsnTZi') # Search location
search_box.send_keys("Hyderabad")
search_box.send_keys(Keys.RETURN)
time.sleep(5) # Let the page load
# Now you can proceed to login or automate event/movie search
# For example: Clicking on a 'Sign In' button and handling further steps
# Example for handling login process
login_button = driver.find_element(By.XPATH, "//span[text()='Sign in']")
login_button.click()
time.sleep(3)
# Optionally, handle further steps like entering mobile number or using Google/Facebook login
# Depending on how BookMyShow handles login, you need to write specific automation for that.
# Keep the browser open for a while to see the result
time.sleep(10)
# Close the browser
driver.quit()
getting this error ; can you please help me resolve this
Metadata
Metadata
Assignees
Labels
No labels
