Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Failed to locate element
#2
gahhon Wrote:but it still same error
What's the error?
You could post all of your code and not just one line.

Do not post image of HTML code.
Can post in forum with code tag or better for HTML CodePen or JSFiddle.
Example Pen,you see that i have put id="txtAccessCode".
When i test local with that html code it work,it send abc123sample to input field.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import time
from bs4 import BeautifulSoup

#--| Setup
options = Options()
#options.add_argument("--headless")
browser = webdriver.Chrome(executable_path=r'C:\cmder\bin\chromedriver.exe')
#--| Parse or automation
browser.get('file:///E:/div_code/scrape/local1.html')
time.sleep(3)
browser.find_element_by_id("txtAccessCode").send_keys("abc123sample")
time.sleep(5)
browser.quit()
 
Reply


Messages In This Thread
Failed to locate element - by gahhon - Feb-17-2019, 04:04 PM
RE: Failed to locate element - by snippsat - Feb-17-2019, 04:39 PM
RE: Failed to locate element - by gahhon - Feb-17-2019, 05:36 PM
RE: Failed to locate element - by snippsat - Feb-17-2019, 07:35 PM
RE: Failed to locate element - by gahhon - Feb-18-2019, 02:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Flask-SqlAlchemy - Relationship failed to locate a name - Please Help howardrwb 0 5,220 Jan-31-2020, 08:38 PM
Last Post: howardrwb

Forum Jump:

User Panel Messages

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