Unable to access element within page

2024/10/6 10:41:47

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?

Answer

[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://en.xdnf.cn/q/118965.html

Related Q&A

How to wtite Erlang B and Erlang C formulas in Python [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic…

Pip is not recognizing the install command (Windows 7, Python 3.3) [duplicate]

This question already has answers here:python3 --version shows "NameError: name python3 is not defined" [duplicate](2 answers)Closed 6 years ago.I am trying to install Python programs using P…

How do I check if 1 is always followed by a 0

In Python, I cannot find a solution as to how to determine whether there is always a 0 following a 1 somewhere in a list of numbers, to form a pair 10. It doesnt have to be direct follower.For clarity,…

Visual Studio Code debugs even when i run without debugging

i just installed VSCode and I used to work on it but now when I try to run without Debugging with Ctrl + F5. it seems to opens up python debug console and debug like below image enter image description…

Mock global function call while importing

Suppose I have a file called a.py with code likeimport mod1 mod1.a()def b():print("hi")Now if I want to mock fun b() then unittest.py while have import statement at top likefrom a import bat …

can the order of code make this program faster?

Hi this is my first post, I am learning how to write code so technically I am a newbie.I am learning python I am still at the very basics, I was getting to Know the if statement and I tried to mix it …

How can I label a node that is the initial vertex in a cycle from graph data

I need to implement an algorithm such that in a collection of unique and ordered graph edges, I can find a cyclic node. E.g. for a ->b, b->c, c->a, then a is a cyclic node and thus I want to a…

Pandas : How to drop #DIV/0! and NA values in new column in pandas dataframe?

I did some calculation and have #DIV/0! in my dataframe. How to drop these values and count further ? I followed df.dropna but dataframe still counting #DIV/0!. Please suggest.df.insert(loc=df.column…

unsupported operand for 3 instances of two classes and one method?

Im trying to get the program to take the hp stat from enemyUnit, the attack stat from unit, and the damage stat from tackle and put them into one math problem in the method getHit(). this is the code:…

Telling the script to wait until button is clickable? [duplicate]

This question already has answers here:Check whether element is clickable in selenium(3 answers)Closed 4 years ago.Im writing a script in Selenium (Python) and I am having an issue with a disabled clic…