kaliiiiiiiiii / Selenium-Driverless

undetected Selenium without usage of chromedriver
https://kaliiiiiiiiii.github.io/Selenium-Driverless/
Other
544 stars 66 forks source link

[Feature request] support moving elements #192

Open boludoz opened 6 months ago

boludoz commented 6 months ago

The clicking system is great, but sometimes it is not correct when there is movement, the button cannot be pressed and it causes a silent error. For example when an image is loading.

kaliiiiiiiiii commented 6 months ago

@boludoz Please provide more information such as

boludoz commented 6 months ago

For example, suppose we disable the loading wait in 'self.get' and use the element wait timeout, which is very useful.

If the website does not finish loading and an image appears that moves a button downwards in a cascading manner, this will cause a click failure, and it is more common than it seems.

Then the code will continue and wait until the next find_element, there the 'silent error' will occur. In the original selenium this will produce a click intercepted exception or something like that.

kaliiiiiiiiii commented 6 months ago

You mean support moving elements ?

boludoz commented 6 months ago

Yes, I think it's more of a "small bug", if an element is not loaded on time it will fail, using javascript to click that doesn't happen but I understand the concept of undetectability which is very effective, maybe create a function for personal use so that it uses moveto but ends the movement with jsclick.

boludoz commented 6 months ago

Maybe you can make the click location check and the click be in the same previous call

kaliiiiiiiiii commented 6 months ago

Maybe you can make the click location check and the click be in the same previous call

Nope, click unfortunately has to be in one call. Only thing possible similarly like that is pausing the debugger. Tho thet ofc is detectable.

boludoz commented 6 months ago

Maybe a pre-check.

boludoz commented 6 months ago

Perhaps a pre-check of the element as a human would do, pausing the page when clicking.

boludoz commented 6 months ago

Can you explain to me how you did this to access an iframe with CDP?

kaliiiiiiiiii commented 6 months ago

Can you explain to me how you did this to access an iframe with CDP?

business secret 🤫😂 Nah it's in the code ofc but - to much to explain for me:/

boludoz commented 5 months ago

Perhaps you can pause the execution of the website for a moment.

kaliiiiiiiiii commented 5 months ago

Perhaps you can pause the execution of the website for a moment.

yeah but that would be detectable

boludoz commented 5 months ago

Perhaps you can pause the execution of the website for a moment.

yeah but that would be detectable

Can't you cut off the internet and disable the cache just before clicking? I think there is a command to do this.

kaliiiiiiiiii commented 5 months ago

Perhaps you can pause the execution of the website for a moment.

yeah but that would be detectable

Can't you cut off the internet and disable the cache just before clicking? I think there is a command to do this.

uh well but the script could save the current time in a variable, even obfuscated etc. just really not feasible. Or detect timing lags over a websocket at server side.

This will have to get implemented by some propper algorithm which takes into account moving elements & generates a mouse path accordingly in real-time.

atm don't have the time nor enough calculus & stats. knowledge to develop that kind of stuff.

boludoz commented 5 months ago

Perhaps you can pause the execution of the website for a moment.

yeah but that would be detectable

Can't you cut off the internet and disable the cache just before clicking? I think there is a command to do this.

uh well but the script could save the current time in a variable, even obfuscated etc. just really not feasible. Or detect timing lags over a websocket at server side.

This will have to get implemented by some propper algorithm which takes into account moving elements & generates a mouse path accordingly in real-time.

atm don't have the time nor enough calculus & stats. knowledge to develop that kind of stuff.

It is not a moving element, but a simple web page that has not yet finished loading its images and there is a button right below it.

kaliiiiiiiiii commented 5 months ago

It is not a moving element, but a simple web page that has not yet finished loading its images and there is a button right below it.

Well but it's still the issue that the element location changes - right? Soo therefore still same approach

boludoz commented 5 months ago

It's true