mardi 18 décembre 2018

javascript click() function does not clicking buynow button of flipkart?

Hi i am new to java script and scripting so for my first fun project i intend to make a price comparison script that can suggest me cheapest smartphone on flipkart shopping site and after all extraction and sorting i came up with my smartphone solution but when i write the script to click the buy now button automatically then it display "undifined" code used to click buy now button :-

document.getElementsByClassName("_2AkmmA _2Npkh4 _2kuvG8 _7UHT_c")[0].click();

link of product :-

flipkart smartphone product page

the twist in this is that when i run code

document.getElementsByClassName("_2AkmmA _2Npkh4 _2kuvG8 _7UHT_c")[0]

then it return html button tag but click function is not working

i don't know what to do so please suggest me a detailed solution

Aucun commentaire:

Enregistrer un commentaire