Unable to input email id to the field (Using python 3.10 and selenium 4.4.3)

Question:

Unable to input email id to the field addition to that can any help me with these errors.[Code Error2

serviceC = Service(r"C:chromedriver_win32chromedriver.exe")
driver = webdriver.Chrome(service=serviceC)

# My gmail credentials
my_username = "[email protected]"
my_password = "mypassword"

# open Wev.flock.com login
driver.get("http://web.flock.com")

print("Website link")
driver.implicitly_wait(10)

# Get started With Flock
Enter_email_id = driver.find_element(By.XPATH, '//*[@id="widgets_InputBox_0"]/input')
# XPATH = '//*[@id="widgets_InputBox_0"]/input'
# Full XPATH = '/html/body/div[3]/div/div[1]/div/div/div[3]/div[3]/input'
Enter_email_id.send_keys(my_username)


# automatically close the driver after 30 seconds
time.sleep(30)
driver.close()

And below I am attaching output via the terminal
Main issue is that I am unable to find the proper address to input field
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="widgets_InputBox_0"]/input"}

Any help would be appriciated

    DevTools listening on ws://127.0.0.1:55084/devtools/browser/fa303344-68e7-4306-a7fd-511ef7d18a15
Website link
[1676:6032:0925/155230.539:ERROR:device_event_log_impl.cc(214)] [15:52:30.540] USB: usb_service_win.cc:415 Could not read device interface GUIDs: The system cannot find the file specified. (0x2)
[1676:6032:0925/155230.540:ERROR:device_event_log_impl.cc(214)] [15:52:30.540] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[1676:6032:0925/155230.541:ERROR:device_event_log_impl.cc(214)] [15:52:30.542] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
Traceback (most recent call last):
  File "d:ProjectsFlockAutomation.py", line 22, in <module>
    Enter_email_id = driver.find_element(By.XPATH, '//*[@id="widgets_InputBox_0"]/input')
  File "C:UsersitadminAppDataLocalProgramsPythonPython310libsite-packagesseleniumwebdriverremotewebdriver.py", line 855, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "C:UsersitadminAppDataLocalProgramsPythonPython310libsite-packagesseleniumwebdriverremotewebdriver.py", line 428, in execute
    self.error_handler.check_response(response)
  File "C:UsersitadminAppDataLocalProgramsPythonPython310libsite-packagesseleniumwebdriverremoteerrorhandler.py", line 243, in check_response
    raise exception_class(message, screen, stacktrace)
**selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="widgets_InputBox_0"]/input"}**
  (Session info: chrome=105.0.5195.127)
Stacktrace:
Backtrace:
        Ordinal0 [0x007BDF13+2219795]
        Ordinal0 [0x00752841+1779777]
        Ordinal0 [0x0066423D+803389]
        Ordinal0 [0x00693025+995365]
        Ordinal0 [0x006931EB+995819]
        Ordinal0 [0x006C0F52+1183570]
        Ordinal0 [0x006AE844+1108036]
        Ordinal0 [0x006BF192+1175954]
        Ordinal0 [0x006AE616+1107478]
        Ordinal0 [0x00687F89+950153]
        Ordinal0 [0x00688F56+954198]
        GetHandleVerifier [0x00AB2CB2+3040210]
        GetHandleVerifier [0x00AA2BB4+2974420]
        GetHandleVerifier [0x00856A0A+565546]
        GetHandleVerifier [0x00855680+560544]
        Ordinal0 [0x00759A5C+1808988]
        Ordinal0 [0x0075E3A8+1827752]
        Ordinal0 [0x0075E495+1827989]
        Ordinal0 [0x007680A4+1867940]
        BaseThreadInitThunk [0x75B46739+25]
        RtlGetFullPathName_UEx [0x76FD8FD2+1218]
        RtlGetFullPathName_UEx [0x76FD8F9D+1165]
Asked By: Sameer

||

Answers:

the element is inside iframe, you can first locator iframe,
I use another python lib, just need 3 lines code to achieve this automation.
It using browser extension, you need install extension first by the code cc.chrome.extension.install_or_update()

from clicknium import clicknium as cc, locator, ui

tab = cc.chrome.open(‘https://web.flock.com/’)
iframe = tab.find_element_by_xpath(‘//[@id="dijit__WidgetsInTemplateMixin_0"]/iframe’)
iframe.find_element_by_xpath(‘//
[@id="widgets_InputBox_0"]/input’).set_text("test")

Answered By: justin

I did get the answer and it was simple just point to iframe then point to element you want to input or click.

iframe = driver.find_element(
By.XPATH, ‘//*[@id="dijit__WidgetsInTemplateMixin_0"]/iframe’
)
driver.switch_to.frame(iframe)

Get started With Flock

Enter_email_id = driver.find_element(By.XPATH, ‘//*[@id="widgets_InputBox_0"]/input’)
driver.implicitly_wait(5)
Enter_email_id.send_keys(my_username)

Login_or_create_btn = driver.find_element(
By.XPATH, ‘//*[@id="uniqName_15_0"]/div[3]/button’
)

Login_or_create_btn.click()

sign_in_with_google=driver.find_element(By.XPATH,’//*[@id="uniqName_17_0"]/div[2]/button’)
sign_in_with_google.click()

Answered By: Sameer