参照:https://www.it1352.com/1955345.html
公式ドキュメントを参照してください:https://zhaoqize.github.io/puppeteer-api-zh_CN/#?product = Puppeteer&version = v5.5.0&show = api-pageselectselector-values
page.select('select#example','carrot');
ここでの注意:JavaScriptのネイティブ選択割り当て方法の使用は、puppeteerでは機能しません[セルフテスト]
ネイティブjsに基づいて可能ですが、puppeteerフレームワークはここでselectセレクターを割り当てることができません![公式ページを使用してください。select( 'select#example'、 'carrot');]
<select class="io">
<option value="1111">sms</option>
<option value="2111">google</option>
</select>
<script>
let ele = document.getElementsByTagName('select')[0];
console.log(ele.value)
</script>