Python Forum
Selenium Select Option Issue
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selenium Select Option Issue
#1
I am facing the select option issue. If anyone have solution please help. Thanks

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from bs4 import BeautifulSoup
import time
 
service = Service(executable_path=r'/usr/bin/chromedriver')
options = webdriver.ChromeOptions()
#options.add_argument('--headless')
options.add_argument("--disable-notifications")
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(service=service, options=options)
driver.get("https://pintod.com")
print(driver.page_source)
inputElement = driver.find_element(By.ID, 'link')
inputElement.send_keys('https://pintod.com')
inputElement.send_keys(Keys.ENTER)
time.sleep(20)
print(driver.page_source)
soup = BeautifulSoup(driver.page_source, 'html.parser')
drop_down_node = driver.find_element(By.ID, 'render_video')
drop = Select(drop_down_node)
drop.select_by_index(1)
time.sleep(10)
input("press any key to continue...")
driver.quit()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Issue installing selenium Akshat_Vashisht 1 1,707 Oct-18-2023, 02:08 PM
Last Post: Larz60+
  Issue installing selenium sayyedkamran 2 9,382 Apr-03-2020, 01:39 PM
Last Post: sayyedkamran
  SQL select join operation in python(Select.. join) pradeepkumarbe 1 2,905 Feb-14-2019, 08:34 PM
Last Post: woooee

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020