Home > other >  Warrior look at how to help breaking through any limits from js selenium input text automatically
Warrior look at how to help breaking through any limits from js selenium input text automatically

Time:04-21

What do you want to be a creeper, automatically commentary, using selenium + chrome

Now meet a problem, the official to limit, without using a simple input class input box, is a kind of dynamic input method, I also don't know much about

Here is no click of the mouse at the time of the image, and the mouse to click the picture of the input text








Tried several kinds of methods:
1, use the mouse to locate elements, positioning to the span or br, and then click the mouse, but again send text prompt element cannot interaction

Br=driver. Find_element_by_xpath ("//*/div/div/div/div [1]/div/div/div [3]/div [2]/div/div [2]/div/div/div/div/div/div/span/br ")
ActionChains (driver). Click (br). The perform ()
S.s end_keys (" 123 ")

2, use js trying to modify the source HTML code, but this simple 123 words can be modified, but complex statements, grammar is always an error
Js='document. GetElementsByTagName (" br "). The innerHTML=+ 123; '//ok, but still can't submit, just can modify 123
D.e xecute_script (js)

Js='document. GetElementsByTagName (" br "). The innerHTML=+ "& lt; Span data - text="true" & gt; 123 & lt;/span> "; '
//want to have 123 changed to code & lt; Span data - text="true" & gt; 123 & lt;/span> , but the grammar is always wrong, don't know much about the js, HTML


You have no other way? Thank you very much!

CodePudding user response:

First approach, certainly cannot interact ah, should to the Tag of the text field and the positioning of the, know a Span Tag positioning, how to interact???
The two methods, at the end of the day, is positioning is wrong

CodePudding user response:

reference 1/f, idle 乄 fish response:
first approach, certainly cannot interaction, should be to the Tag of the text field and the positioning of the, know a Span Tag positioning, how to interact???
The two methods, in the final analysis, is located in the wrong


Problem is that the official in order to prevent automatic message, make the abnormal input, couldn't find text input label, feel like by js dynamically generated

the mouse didn't point text box input text, I see the interface is:

the mouse point text box, enter 123, become the appearance,

"; '


So this how to do?

Thank you for your guidance!

CodePudding user response:

To the one above contenteditable="true" div tags try positioning, should be ok
  • Related