我一直在尝试从下拉列表中进行选择,但似乎不知道如何选择
以下是我想要得到的:
<div _ngcontent-wdj-c58="" class="delivery-group">
<span _ngcontent-wdj-c58="">Guaranteed Delivery Time:</span>
<div _ngcontent-wdj-c58="" class="select-container">
<ng-select _ngcontent-wdj-c58="" class="ng-select ng-select-single ng-select-clearable ng-pristine ng-invalid ng-select-bottom ng-touched" formcontrolname="guaranteedDeliveryTime" notfoundtext="No options" placeholder="Choose" role="listbox">
<div class="ng-select-container">
<div class="ng-value-container">
<div class="ng-placeholder">Choose</div>
<!---->
<!---->
<div class="ng-input"><input role="combobox" type="text" autocorrect="off" autocapitalize="off" autocomplete="a67359450338" readonly="" aria-expanded="false"></div>
</div>
<!---->
<!---->
<span class="ng-arrow-wrapper">
<span class="ng-arrow"></span></span>
</div><!----></ng-select>
<div _ngcontent-wdj-c58="" class="select-validation">
<eld-shared-validation _ngcontent-wdj-c58="" message="Specify delivery time." _nghost-wdj-c55="">
<!---->
</eld-shared-validation>
</div></div></div>
更新: 当我使用selenium时,请选择:
a =Select(driver.find_element_by_xpath('/html/body/eld-root/div[2]/div[2]/div/eld-sell-page/div/section/eld-place-offer/div/div/eld-shared-offer-edit-form/form/div[1]/div[1]/div/ng-select'))
我得到一个错误:
UnexpectedTagNameException: Message: Select only works on <select> elements, not on <ng-select>
项目代码html为:
<div class="ng-dropdown-panel-items scroll-host">
<div>
</div>
<div>
<!---->
<!---->
<div class="ng-option ng-star-inserted ng-option-marked" role="option" aria-selected="false" id="a67359450338-0">
<!---->
<!---->
<span class="ng-option-label ng-star-inserted">20 min</span>
</div>
<div class="ng-option ng-star-inserted" role="option" aria-selected="false" id="a67359450338-1">
<!---->
<!---->
<span class="ng-option-label ng-star-inserted">1 h</span
></div>
<div class="ng-option ng-star-inserted" role="option" aria-selected="false" id="a67359450338-2">
<!---->
<!----><span class="ng-option-label ng-star-inserted">5 h</span>
</div>
<div class="ng-option ng-star-inserted" role="option" aria-selected="false" id="a67359450338-3">
<!---->
<!---->
<span class="ng-option-label ng-star-inserted">1 day</span>
</div>
<div class="ng-option ng-star-inserted" role="option" aria-selected="false" id="a67359450338-4">
<!---->
<!---->
<span class="ng-option-label ng-star-inserted">2 days</span
></div>
<div class="ng-option ng-star-inserted" role="option" aria-selected="false" id="a67359450338-5">
<!---->
<!---->
<span class="ng-option-label ng-star-inserted">7 days</span>
</div>
<div class="ng-option ng-star-inserted" role="option" aria-selected="false" id="a67359450338-6">
<!---->
<!----><span class="ng-option-label ng-star-inserted">28 days</span>
</div>
<!---->
<!---->
<!---->
<!---->
</div>
</div>
我尝试使用webdriver==>;选择 或者找到元素并单击()并发送_键(某些内容),但它们不起作用
该网站是https://www.eldorado.gg/和见选择框应该去出售和为我的情况下,部落冲突,然后你看到,当你想填补空白 但我们应该注册 如果可能,检查一个站点,看看是否 tnx
如异常中所述,Select应与
<select>
标记一起使用在您的例子中,没有selecthtml元素,所以您必须使用如下所示的其他选项
相关问题 更多 >
编程相关推荐