Я не могу найти элемент с помощью библиотеки Selenium.Я попробовал по id, по Xpath, ничего ... почти наверняка есть что-то в html iframe или framesets, но я также попытался driver.switch_to.frame
безуспешно.Я новичок в Python, поэтому, спасибо за терпение при объяснении.
Идея состоит в том, чтобы автоматизировать использование сценария для ввода данных в интрасеть компании.
Вот код, который я пробовал такдалеко и некоторые комментарии:
import selenium
from selenium import webdriver
import time
driver = selenium.webdriver.Chrome(r'C:\Users\tvalente\PycharmProjects\TESTEs\descriptionCapture\chromedriver.exe')
driver.get('https://quest.slb.com/quest/QuestLogInx.asp?NextRptType=&NextQPID=') #this page is just an automatic login to redirect to another page
time.sleep(7)
driver.get('https://quest.slb.com/quest/IndexIE.asp') #as i dont know to use Selenium very well yet, to make sure im requesting the element on the correct page, i asked the browser to refresh at the redirected page. If there is a way to do it without refreshing the URL, also appreciate the help ! For example, if i click on a link which will redirect to a new page, do i need to use the driver.get('new page URL') again to work on the tags or there is another way ?
time.sleep(4)
driver.switch_to.frame('navframe') #please see HTLM code below. this is the iframe.
reportnumber = driver.find_element_by_id('strCriteria') #this is the text field tag id inside the iframe.
reportnumber.send_keys('testandto') #This is what i want to text before submit
Ниже приведен HTML-код:
Не уверен, как я могу поделиться изображением с моего компьютера здесь ...