找不到选择器的元素:#react-select-17-option-0(下拉菜单)

发布于 2025-02-13 08:16:04 字数 408 浏览 0 评论 0原文

我正在尝试从页面中选择一个下拉菜单,但无法使用Puppetteer选择其中一个选项。我已经检查了元素选择器。页面只有1帧,这是html源代码在这里输入图像说明

等待page.click('输入[id =“ react-select-7-input”]')我在屏幕截图中获取下拉次数,而是在html中而不是更改输入的值,它添加了一个DIV,其中“常规护照”是选项2

输入图像描述在这里< /a>

I am trying to select a dropdown menu from a page but unable to select one of the options using puppetteer. I have checked the element selector. the page is only 1 frame this is the html source code enter image description here

When I click on await page.click('input[id="react-select-7-input"]') I get the dropdown in a screenshot but in the html instead of the value of the input being changed it adds a div with "Regular Passport" which is option 2

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凯凯我们等你回来 2025-02-20 08:16:04

好吧,今天奏效了!我不知道发生了什么,也许该页面有一个错误?

这件代码做到了,我昨天尝试了!

await page.click('#react-select-7-input');
await delay(wait_time);
await page.click('#react-select-7-option-2');
await delay(wait_time);

Well today it worked! I have no idea what was happening maybe the page had a bug?

this piece of code did it which I tried yesterday!

await page.click('#react-select-7-input');
await delay(wait_time);
await page.click('#react-select-7-option-2');
await delay(wait_time);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文