python selenium点击隐藏的下拉项目

时间:2016-10-15 14:35:20

标签: javascript python selenium post selenium-chromedriver

我正在使用python selenium chromedriver

我可以在 driver.page_source 中看到,无法看到选项值。

<select name="ctl00$cp$ucSearch_Manual$ddlMerk" onchange="updateInputForServerNoPB();InvalidateVehicleSearchResult();setTimeout(&#39;__doPostBack(\&#39;ctl00$cp$ucSearch_Manual$ddlMerk\&#39;,\&#39;\&#39;)&#39;, 0)" id="ctl00_cp_ucSearch_Manual_ddlMerk" disabled="disabled" class="NormalDropdownlist" style="width:174px;">
            <option selected="selected" value="-1">- Kies merk -</option>

        </select>

但是当我向链接发出POST请求时,我看到响应有选项值:

<select name="ctl00$cp$ucSearch_Manual$ddlMerk" onchange="updateInputForServerNoPB();InvalidateVehicleSearchResult();setTimeout(&#39;__doPostBack(\&#39;ctl00$cp$ucSearch_Manual$ddlMerk\&#39;,\&#39;\&#39;)&#39;, 0)" id="ctl00_cp_ucSearch_Manual_ddlMerk" class="NormalDropdownlist" style="width:174px;">
        <option selected="selected" value="-1">- Kies merk -</option>
        <option value="95">Alfa Romeo</option>
        <option value="154">Aston Martin</option>
        <option value="96">Audi</option>
        <option value="97">Bentley</option>
        <option value="98">BMW</option>
        <option value="352">Bugatti</option>
        <option value="100">Cadillac</option>
        <option value="342">Chevrolet</option>
        <option value="101">Chevrolet USA</option>
        <option value="102">Chrysler</option>
        <option value="103">Citroen</option>
        <option value="337">Corvette</option>
        <option value="104">Dacia</option>
        <option value="105">Daihatsu</option>
        <option value="162">Dodge</option>
        <option value="106">Donkervoort</option>
        <option value="107">Ferrari</option>
        <option value="108">Fiat</option>
        <option value="439">Fisker</option>
        <option value="94">Ford</option>
        <option value="111">Honda</option>
        <option value="112">Hyundai</option>
        <option value="365">Infiniti</option>
        <option value="113">Jaguar</option>
        <option value="114">Jeep</option>
        <option value="150">Kia</option>
        <option value="116">Lamborghini</option>
        <option value="117">Lancia</option>
        <option value="168">Land Rover</option>
        <option value="432">Landwind</option>
        <option value="118">Lexus</option>
        <option value="119">Lotus</option>
        <option value="120">Maserati</option>
        <option value="330">Maybach</option>
        <option value="121">Mazda</option>
        <option value="474">McLaren</option>
        <option value="122">Mercedes-Benz</option>
        <option value="304">Mini</option>
        <option value="124">Mitsubishi</option>
        <option value="126">Morgan</option>
        <option value="127">Nissan</option>
        <option value="128">Opel</option>
        <option value="130">Peugeot</option>
        <option value="132">Porsche</option>
        <option value="134">Renault</option>
        <option value="135">Rolls-Royce</option>
        <option value="138">Saab</option>
        <option value="139">Seat</option>
        <option value="140">Skoda</option>
        <option value="226">smart</option>
        <option value="343">Spyker</option>
        <option value="210">SsangYong</option>
        <option value="141">Subaru</option>
        <option value="142">Suzuki</option>
        <option value="434">Tesla</option>
        <option value="417">Think</option>
        <option value="144">Toyota</option>
        <option value="147">Volkswagen</option>
        <option value="145">Volvo</option>

    </select>

使用java-script或类似的东西如何选择我在 Driver.page_source 中无法看到的下拉值?

0 个答案:

没有答案