error: selenium.common.exceptions.TimeoutException: Message:

117
January 15, 2021, at 09:50 AM

in the code below, I tried to log in to a website using selenium But I get this error selenium.common.exceptions.TimeoutException: Message:

Thanks in advance

Code:

from selenium import webdriver
from bs4 import BeautifulSoup
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
URL = 'website'
options = webdriver.ChromeOptions()
options.add_argument("headless")
options.add_argument('--no-sandbox')   
options.add_argument('--disable-dev-shm-usage')
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(options=options)
driver.get(URL)
wait = WebDriverWait(driver, 10)
#-------------------------------------------------------------------
wait.until(EC.presence_of_element_located((By.ID,"username"))).send_keys("nocsud")
wait.until(EC.presence_of_element_located((By.ID,"value"))).send_keys("noc_sud10")
driver.find_element_by_id("submitDataverify").click()

#-------------------------------------------------------------------
soup = BeautifulSoup(driver.page_source, 'html.parser')
driver.quit()
root = soup.find(id='root')
print(root)
Answer 1

i would recommend you to use options.add_argument("interactive") that let you see what's happening in the webpage and where is the code stopped at, probably one of the elements that you are searching in the DOM are not found wait.until(EC.presence_of_element_located((By.ID,"username"))).send_keys("nocsud") wait.until(EC.presence_of_element_located((By.ID,"value"))).send_keys("noc_sud10")

try to check if "value" or "username" are ID's or Names

READ ALSO
jetpack compose not responding to keyboard input on emulator

jetpack compose not responding to keyboard input on emulator

The software keyboard works while keyboard has no response

204
Hexagon Grid CSS - All hexagons change size when each of them is clicked

Hexagon Grid CSS - All hexagons change size when each of them is clicked

I have 8 hexagons made purely with HTML and CSS and the code is taken from this exampleHowever, I have inserted my own images in them

48
Get count of items that matches a condition from mongo db in node js

Get count of items that matches a condition from mongo db in node js

I am new to mongo dbI have a scenario where I need to check into collection and the count of items having gameDate = current date

128