Advertisement
ssdnet

Untitled

May 21st, 2024
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. I need your advide or idea or whatever.
  2.  
  3. XenForo:
  4. We have a python function "Get element list when id contains" with parameter "_xfUid-".
  5. This function will get all the elements when their id's contain "_xfUid-" and save them in a local variable.
  6.  
  7. Now when setting the username/password/email to register, we have a function "Send keystroke when attribute of element in list contains".
  8. We can feed 2 parameter to that function: Attribute to look for "autocomplete", and the attribute value "username".
  9. So what that does is, it search in the grabbed element list for elements with attribute "autocomplete" and value of "username" snd when found send keystrokes to that (setting the username).
  10.  
  11. Here is the corresponding xenforo input field:
  12. <input type="text" class="input" name="3d244745b3dc8e119a29afb08b56b3e1e887982f" autocomplete="username" required="required" autofocus="autofocus" maxlength="25" id="_xfUid-2-1716287180">
  13.  
  14. As you can see, the name is dynamic, so I needed other ways to locate the element.
  15.  
  16. The issue is the 2 separate functions, get element list and send keystrokes. Would it be better to join them into 1 function with parameters like:
  17. element identifier (_xfUid-)
  18. attribute name (autocomplete)
  19. attribute value (username)
  20.  
  21. Something like "Locate element where ID contains "_xfUid-", attribute is "autocomplete" and attribute value is "username"?
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement