Unable to access element within page

懵懂的女人 提交于 2020-01-26 03:59:25

问题


Form Screenshot HTML Inspect Code screenshot

I'm trying to access an element within a page. Cannot give out the exact page link owing to security concerns. I'm writing a python program that uses selenium to access the element first name in the screenshot shown above. The name is grayed out at first and whenever a user clicks on it, the text becomes black and can be edited.

The field simply does not seem to be visible to the program and the program fails with an element not found exception. I've used a wait method for the element to be visible but it just times out. I've tried waiting for it to be clickable, and I have tried injecting javascript to make the display style = block. None of this seems to work. I've researched extensively on StackOverflow and none of the options there seem to work for me. I spoke to the front-end developers and they tell me that apart from the div style display, there's nothing else they can think of because the element is visible in the DOM.

Does anybody know how I can access this element?


回答1:


[Resolved] Turns out there was a javascript code that would change the DOM whenever another button was clicked. So, all I had to do was re-query the DOM and then the element was visible. Thanks very much to all those who took the time to answer this question.



来源:https://stackoverflow.com/questions/44293962/unable-to-access-element-within-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!