我正在尝试使用 BeautifulSoup 从以下 HTML 中获取选定的值,但无法获取。
<select id="bySeason" tconst="tt0944947" class="current">
<!--
This ensures that we don't wind up accidentally marking two options
(Unknown and the blank one) as selected.
-->
<option value="1">
1
</option>
<!--
This ensures that we don't wind up accidentally marking two options
(Unknown and the blank one) as selected.
-->
<option selected="selected" value="8">
2
</option>
</select>
这就是我正在尝试但徒劳的。
season_container = page_html.find_all("select", class_="current")
print(season_container.find_all('option', selected=True))
慕的地8271018
慕码人2483693
相关分类