The TikTok comment input is not visible on puppeteer, but visible in browser.
Browser screenshot
Puppeteer screenshot
I have tried to zoom out and to adjust the viewport without results.
I have written the code, but am not able to find the selector as previously mentioned.
async function commentVideo(page, videoElement) {
const commentInputSelector = '[data-e2e="comment-input"]';
await page.waitForSelector(commentInputSelector, { visible: true
});
const comment = await generateComment();
await page.focus(commentInputSelector);
await page.keyboard.type(comment, { delay: 100 });
await page.evaluate(() => {
const postBtn = document.querySelector('[data-e2e="comment-
post"]');
postBtn.click();
});
console.log("Comment posted:", comment);
}