0
我試圖從HTML的網頁中提取的事件 - http://www.staffordshire-pcc.gov.uk/space/如何訪問/設置「選擇」標記HTML中使用Python
我想用Python來選擇不同的領域,但與下面的HTML遭遇了挫折:
<select data-ng-options="key as value.name for (key,value) in areaGroups | orderBy:'name'" data-ng-model="selectedAreaGroup" data-ng-change="updateAreaGroup()" class="ng-pristine ng-valid ng-touched">
<option value="" class="" selected="selected">Choose an area</option>
<option value="string:CannockChase" label="Cannock Chase District">Cannock Chase District</option>
<option value="string:EastStaffordshire" label="East Staffordshire">East Staffordshire</option>
<option value="string:Lichfield" label="Lichfield District">Lichfield District</option>
<option value="string:Newcastle" label="Newcastle Borough">Newcastle Borough</option>
<option value="string:SouthStaffordshire" label="South Staffordshire">South Staffordshire</option>
<option value="string:Stafford" label="Stafford Borough">Stafford Borough</option>
<option value="string:StaffordshireMoorlands" label="Staffordshire Moorlands">Staffordshire Moorlands</option>
<option value="string:SoTCentral" label="Stoke-on-Trent Central">Stoke-on-Trent Central</option>
<option value="string:SoTNorth" label="Stoke-on-Trent North">Stoke-on-Trent North</option>
<option value="string:SoTSouth" label="Stoke-on-Trent South">Stoke-on-Trent South</option>
<option value="string:Tamworth" label="Tamworth Borough">Tamworth Borough</option>
我用機械化找到網頁上的表格,但因爲沒有連接到標籤的形式,我不能工作了我會怎麼選擇它,然後提交一個值。
我追求的最佳選擇是什麼?
我有一半的方式有,但無法解決item.attrs ['value']位。感謝您的時間。 – elksie5000