Python Forum
Selenium press "select option" button (SOLVED)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selenium press "select option" button (SOLVED)
#1
sorry for my bad english,
i tried this since yesterday,
i tried to press a button that turn out that button is "select option",
i dont know how, but the page do nothing when i "select_by_index(1)"

this is the code

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://bravedown.com/id/bilibili-downloader/")
print(driver.page_source)
inputElement = driver.find_element(By.ID, 'link')
inputElement.send_keys('https://www.bilibili.com/video/BV1ru411G7f2')
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()
i don't know how i continue this code,
i will appreciate google keyword, google link, clue, or anything else,
please help me

EDIT : after i update the selenium, the code is working
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Click on a button on web page using Selenium Pavel_47 7 4,728 Jan-05-2023, 04:20 AM
Last Post: ellapurnellrt
  How to make use of this button with selenium? Nohah 0 1,019 Sep-22-2022, 10:22 AM
Last Post: Nohah
  Log In Button Won't Click - Python Selenium Webdriver samlee916 2 3,842 Jun-07-2020, 04:42 PM
Last Post: samlee916
  To select only the latest value with Selenium codessu 2 1,961 May-16-2020, 03:51 AM
Last Post: codessu
  Selenium: accessing a drop-down menus without select tags ClassicalSoul 0 2,077 Apr-19-2020, 03:53 PM
Last Post: ClassicalSoul
  Error clicking button with selenium julio2000 4 5,373 Jan-06-2020, 10:59 AM
Last Post: julio2000
  Selenium click on popup button??? GuJu 7 7,932 Jul-20-2019, 09:21 AM
Last Post: Nizam
  Unable to select iframe using selenium endejoli 1 3,004 Jan-11-2018, 05:13 PM
Last Post: j.crater
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,647 Nov-03-2017, 08:41 PM
Last Post: metulburr
  Click dropdown menu option with Selenium PyChrome AcszE 3 5,947 Oct-26-2017, 10:07 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

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