Cannot Click Button; Tried JS, Tried C#, Tried Emulator, Manually Works Though

txseo

Client
Регистрация
31.05.2013
Сообщения
23
Благодарностей
0
Баллы
1
I cannot seem to solve, I am trying add an image to the FB marketplace with Zennoposter and cannot. I have exhausted all possibilities but nothing will click the Add Photos button inside of FB marketplace.


/// JS VERSION
function wait(ms){
var d = new Date();
var d2 = null;
do {
d2 = new Date();
}
while(d2-d < ms);
}
///
popWindows = document.querySelectorAll("div[role='dialog']");

for (q = 0; q < popWindows.length; q++) {

if(popWindows[q].innerHTML.indexOf('2007 Infiniti M35 X Technology Package : AWD Sedan : Fully Loaded') != -1 ){
console.log('insidePop');
myIMGS = popWindows[q].querySelectorAll("div[data-testid='media-attachment-photo']");
//console.log(myIMGS.length);

for (i = 0; i < myIMGS.length; i++) {
//return myIMGS.length;
myIMGS.getElementsByTagName("button")[0].click();

}
wait(2000);
clickthis = popWindows[q].querySelector("input[title='Choose a file to upload']");
console.log(clickthis.length);

clickthis.click();

}
}

/// Even Tried C# with Coordinates
instance.ActiveTab.MouseMove(200, 250, 155, 602, true);
instance.ActiveTab.MouseClick(155, 602, "left", "click");


/// Manually works though
If I manually use my mouse to click the add photos button it works

What Gives?
 
Последнее редактирование:

Nick

Client
Регистрация
22.07.2014
Сообщения
1 983
Благодарностей
817
Баллы
113
I also had problems with some Facebook sites. They use some sophisticated JS that probably tracks your move moves, it has to roll over slowly and hover then click... so I just gave up and made in in a mobile version where such a problem doesn't exist
 

txseo

Client
Регистрация
31.05.2013
Сообщения
23
Благодарностей
0
Баллы
1
I guess that means that, to your knowledge, there probably isn't a method to take over the mouse pointer in order to accomplish that task. Would that be correct?
 

Nick

Client
Регистрация
22.07.2014
Сообщения
1 983
Благодарностей
817
Баллы
113
I think it might be possible, you can wait for another hint from someone... I would try executing .Focus() or something before doing the .Click(). Or sniff the traffic that happens after clicking and emulare POST request that sends the file. It might actually work.
 

txseo

Client
Регистрация
31.05.2013
Сообщения
23
Благодарностей
0
Баллы
1
Good idea Nick! Hey, I tried your idea for using mobile, but unfortuneatley FB wants to kick me over to using an app. Do you have a solution for accessing the mobile market via browser?
 

Nick

Client
Регистрация
22.07.2014
Сообщения
1 983
Благодарностей
817
Баллы
113
nope, sorry
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43
I have one website with the same problem, the solution for me is send focus to button and press key enter :p
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)