Home>
Hello.
Python Selenium, but I get an error.
Is the error caused by using ('id') as the username id selector?
How should I specify in this case?
Please tell me who you understand.
Thank you.
<>
driver = webdriver.Chrome ("Selenium/chromedriver.exe")
elem_username.send_keys ('**')
elem_password = driver.find_element_by_id ('passwd')
elem_password.send_keys ('**')
driver.find_element_by_class_name ('login-button'). click ()
<
NoSuchElementException: Message: no such element: Unable to locate element: {"method": "css selector", "selector": "[id =" id "]"}
(Session info: chrome = 78.0.3904.108)
-
Answer # 1
-
Answer # 2
find_element_by_id ('id')
is no problem for<~~~ id = "id" ~~>
The error is that the element does not exist at that time.
Stop running and check with your browser developer tools.Or, use a method that waits for that element.
Related articles
- python - about pythinista3 selenium browser controls
- some elements cannot be clicked in python selenium (chrome)
- about moving to another page with python selenium
- python - i want to search only a part of html (a certain selector) with find_all of beautifulsoup
- python - i'm using selenium the text sent by send_keys to the input tag disappears when the text is sent by send_key to the next
- python - parameter "form" should contain a valid django form in django
- python sarimax valueerror: maxlag should be <what causes nobs?
- website button clicks in selenium and python
- specifying css selector when scraping wikipedia in python
- i want to display images periodically in python, what should i do?
- [python] i can't open a new firefox tab in selenium a new window will open
- python - [selenium] click the radio button
- python - how to get "job description" of hello work with selenium
- python selenium data extraction error
- python - open another tab of selenium
- python - [selenium] i want to click the dropdown, but an error is returned
- python - error when scraping with selenium and firefox
- python - selenium: element specification an error occurs in the code that can be executed once
- python - i want to get multiple elements with selenium
- get a site to display dynamically with python selenium
Related questions
- python : Selenium. How to click only on certain subclasses if parent classes are duplicated?
- python : How to scroll an element in selenium
- Python Selenium Firefox popup
- python : Parsing a dynamic table
- python : I don't know how to specify a filename when downloading a file from Selenium using Chrome
- python : The sample code of "Transition to specified url" cannot be executed
- Python Selenium Steam Authorization
- python : Error while deploying "git push heroku master"
- python : Loop problem ?????? How to solve? [closed]
- Selenium python error
If you look closely at the source
elem_username = not driver.find_element_by_id ('id')
elem_username = driver.find_element_by_name ('id')
Thank you very much.