[英]Obtain data in drop down html box using python
我想在下拉框中獲取模型:
http://www.trademe.co.nz/motors/used-cars/bmw
from bs4 import BeautifulSoup
import requests
url="http://www.trademe.co.nz/motors/used-cars/bmw"
r= requests.get(url)
soup = BeautifulSoup(r.content)
price=soup.find("select",{"id":"15"})
options = price.find_all("option")
print(options)
產量
[<option selected="selected" value="">Any model</option>]
我想要下拉列表中所有模型的列表。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.