Help needed to fill input inside iframe of different origin. #1919
Unanswered
waysiPire0
asked this question in
Q&A
Replies: 2 comments 1 reply
-
i use tab.evaluate on nike website function triggerKeyEvent(element, eventType, key) {
const event = new KeyboardEvent(eventType, {
key: key,
char: key,
keyCode: key.charCodeAt(0),
which: key.charCodeAt(0),
bubbles: true,
cancelable: true
});
element.dispatchEvent(event);
}
function emulateTyping(element, text, interval = 100) {
let index = 0;
function typeCharacter() {
if (index < text.length) {
const char = text[index];
triggerKeyEvent(element, 'keydown', char);
element.value += char;
triggerKeyEvent(element, 'keypress', char);
triggerKeyEvent(element, 'keyup', char);
index++;
setTimeout(typeCharacter, interval);
}
}
typeCharacter();
}
var CVV = 100
document.querySelectorAll('iframe').forEach((iframe) => {
if (iframe.src.includes('paymentcc')) { // select only the payment iframe
let iframe_tab = iframe.contentWindow.document.body;
let number = iframe_tab.querySelector('#cvNumber');
emulateTyping(number, CVV, 10);
}
});``` |
Beta Was this translation helpful? Give feedback.
1 reply
-
@LinuxTux193 can you help me I can pay for it I have some task on telegram @iamdev2 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi community.
I am automating a website using nodriver where i need to fill credit card information. unluckily i got a scenario where there are 2 nested iframes.
i can access the content of 1st iframe but i can't access the content of 2nd iframe and 2nd iframe contain the cvv input field. 2nd iframe origin is different.
Any help is valuable to me, thank you
Beta Was this translation helpful? Give feedback.
All reactions