i have a puppeteer scraper and i have to insert credit card information. I have no problem to access Cvv and Expire field, but i cannot type in cc number field.
the input filed in inside iframe llike this
<iframe src="bla bla bla my url" scrolling="no" name="FrameCCPay" id="FrameCCPay" frameborder="0" allowtransparency="true" style="width: 100px; height: 18px; border: none; margin: 0px; padding: 0px; min-width: 100%; overflow: hidden;"></iframe>
In frame's document there is this code
<div class="placePan">
<div class="input-container">
<input type="tel" autocomplete="off" spellcheck="false" name="482e7f7b-59aa-3f0d-bde7-8dcf6bcee7a7" class="cleavePan hasError" id="482e7f7b-59aa-3f0d-bde7-8dcf6bcee7a7" maxlength="24" placeholder="Numero Carta" style="display: inline-block;">
<input type="tel" autocomplete="off" spellcheck="false" class="cleavePan" id="482e7f7b-59aa-3f0d-bde7-8dcf6bcee7a7_bin" maxlength="24" placeholder="Numero Carta" style="display: none;">
</div>
</div>
My Puppetier code
const frame = getFrame(this.page, "FrameCCPay")
await frame.waitForSelector(".placePan input")
await frame.focus('.placePan input')
await frame.type(".placePan input", mynumber)
This code is working for the other filed as i said, and the filed ae done in the same way. The only difference is that cc umber have two input filed with same class (.placePan input) so i think it's here the problem.
I can use TYPE function in the right input type? how can i exlucde the .placePan input that is hidden?
If you think the issue is the hidden input, use a selector with an attribute that is present in the needed input only: ".placePan input[name]".