Если вы посмотрите на HTML веб-сайта, вы увидите, что ваше поле ввода находится внутри так называемого #shadowroot
.
![enter image description here](https://i.stack.imgur.com/c8stn.png)
These shadowroots prevent you from finding the elements contained within the shadowroot using a simple find_element_by_id
. You can fix this by finding all the parent shadowroots that contain the element you are looking for. In each of the shadowroots you will need to use javascript's querySelector and find the next shadowroot, until you can access the element you were looking for.
In your case you would need to do the following:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver =webdriver.Chrome()
driver.get('https://www.virustotal.com/gui/join-us')
print(driver.title)
# wait a bit untill form pops up
time.sleep(3)
# Retrieve the last shadowroot using javascript
javascript = """return document
.querySelector('vt-virustotal-app').shadowRoot
.querySelector('join-us-view').shadowRoot
.querySelector('vt-ui-text-input').shadowRoot"""
shadow_root = driver.execute_script(javascript)
# Find the input box
search = shadow_root.find_element_by_id("input")
search.send_keys("Muhammad Aamir")
search.send_keys(Keys.RETURN)
time.sleep(5)
driver.quit()