我正在尝试在以下代码中找到订单列表。但这是市场封闭的时期,我无法下任何订单。但是我想知道是否可以找到它们的占位符。我想做的是读取队列中的哪些订单以及什么数量和价格? 以下代码是我在带有蓝色框的图片中指定的元素的代码。
<div ng-include="'/App/Views/Order/openOrderListInDashborad.html'" ng-controller="OpenOrderListController" ng-if="tabSelected==1" class="maxheight ng-scope">
<form id="antiForgeryOrderListForm" class="maxheight ng-pristine ng-valid ng-scope">
<div style="height:calc(100% - 41px);overflow: auto" class="w1360">
<table class="table-layot-bottom" show-filter="showFilter">
<thead>
<tr>
<th><input type="checkbox" ng-model="orderSelection.selectAll" ng-change="selectAll(filteredOrders)" class="ng-pristine ng-untouched ng-valid ng-empty"><span>ردیف</span></th>
<th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='DecisionId'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">شماره سفارش<span ng-show="predicate=='DecisionId'" class="ng-hide"></span></th>
<th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='CreationDate'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">ساعت<span ng-show="predicate=='CreationDate'" class="ng-hide"></span></th>
<th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='ContractCode'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">کد قرارداد<span ng-show="predicate=='ContractCode'" class="ng-hide"></span></th>
<th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='OrderSide'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc"> نوع سفارش<span ng-show="predicate=='OrderSide'" class="ng-hide"></span></th>
<th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='TradedQuantity'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">حجم معامله شده<span ng-show="predicate=='TradedQuantity'" class="ng-hide"></span></th>
<th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='LastRemainigQuantity'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc"> حجم در صف <i title="جمع حجم در صف" class="counts sum ng-binding"> 0 </i><span ng-show="predicate=='LastRemainigQuantity'" class="ng-hide"></span></th>
<th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='Price'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">قیمت<span ng-show="predicate=='Price'" class="ng-hide"></span></th>
<th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='DecisionUiState'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">وضعیت<span ng-show="predicate=='DecisionUiState'" class="ng-hide"></span></th>
<th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='Channel'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">درگاه ثبت<span ng-show="predicate=='Channel'" class="ng-hide"></span></th>
<th colspan="2"><button type="button" class="btn refresh" tooltip-right="" tooltip="بارگذاری مجدد" ng-click="reload()"><i class="iconRefresh"></i></button></th>
<th></th>
</tr>
<tr ng-show="showFilter" class="tableFilters ng-hide">
<th class="filter"></th>
<th class="filter"></th>
<th class="filter">
<select ng-model="search.ContractCode" ng-options="c.Symbol as c.Symbol for c in symbols" class="ng-pristine ng-untouched ng-valid ng-empty">
<option value="string:" selected="selected"></option>
<option label="SAFTR98 " value="string:SAFTR98 ">SAFTR98 </option>
<option label="SAFMO98 " value="string:SAFMO98 ">SAFMO98 </option>
<option label="OSFTR98 " value="string:OSFTR98 ">OSFTR98 </option>
<option label="OSFMO98 " value="string:OSFMO98 ">OSFMO98 </option>
</select>
</th>
<th class="filter">
<select style="width:100%" ng-model="search.OrderSide" class="ng-pristine ng-untouched ng-valid ng-empty">
<option value=""></option>
<option value="0">خرید</option>
<option value="1">فروش</option>
</select>
</th>
<th class="filter"><input type="text" ng-model="search.TradedQuantity" class="ng-pristine ng-untouched ng-valid ng-empty"></th>
<th class="filter"><input type="text" ng-model="search.LastRemainigQuantity" class="ng-pristine ng-untouched ng-valid ng-empty"></th>
<th class="filter"><input type="text" ng-model="search.Price" class="ng-pristine ng-untouched ng-valid ng-empty"></th>
<th class="filter">
<select style="width:100%" ng-model="search.DecisionUiState" class="ng-pristine ng-untouched ng-valid ng-empty">
<option value=""></option>
<option value="101">ثبت شده در بورس</option>
<option value="109">ثبت شده در سیستم</option>
<option value="107">رد شده توسط سیستم</option>
<option value="106">رد شده توسط بورس</option>
<option value="112">قسمتی معامله شده</option>
</select>
</th>
<th class="filter">
<select style="width:100%" ng-model="search.Channel" class="ng-pristine ng-untouched ng-valid ng-empty">
<option value=""></option>
<option value="0">آنلاین</option>
<option value="1">سما</option>
<option value="3">صحرا</option>
<option value="4">سیستم</option>
</select>
</th>
<th class="filter"><input type="text" ng-model="search.DecisionId" class="ng-pristine ng-untouched ng-valid ng-empty"></th>
<th></th>
<th style="width:20px!important"></th>
</tr>
</thead>
<tbody loading-container="loading" class="ng-isolate-scope loadingContainer">
<!-- ngRepeat: order in (filteredOrders = ($root.orders | orderBy:predicate:reverse | filter:search) ) -->
<div ng-show="isLoading" class="loading ng-scope ng-hide"><span class="loadingPos"><span class="borderloading"></span><span class="logoLoader"></span></span></div>
</tbody>
</table>
</div>
<div class="filter-part">
<label class="part" ng-init="showFilter=false"><i class="Font Ico-filter" style="cursor: pointer" ng-click="showFilter=!showFilter;"></i></label>
<label class="part">
<span> نوع سفارش: </span>
<select ng-model="search.OrderSide" ng-options="c.id as c.title for c in orderType" class="ng-pristine ng-untouched ng-valid ng-empty">
<option label="همه" value="string:" selected="selected">همه</option>
<option label="خرید" value="number:0">خرید</option>
<option label="فروش" value="number:1">فروش</option>
</select>
</label>
|
<label class="part">
<span> سررسید: </span>
<select ng-model="search.ContractCode" ng-options="c.Symbol as c.Symbol for c in symbols" class="ng-pristine ng-untouched ng-valid ng-empty">
<option value="string:" selected="selected"></option>
<option label="SAFTR98 " value="string:SAFTR98 ">SAFTR98 </option>
<option label="SAFMO98 " value="string:SAFMO98 ">SAFMO98 </option>
<option label="OSFTR98 " value="string:OSFTR98 ">OSFTR98 </option>
<option label="OSFMO98 " value="string:OSFMO98 ">OSFMO98 </option>
</select>
</label>
|
<label class="part">
<!-- ngIf: selectedOrdersNumber() -->
</label>
</div>
</form>
</div>
这是我用来查找页面其他元素(价格)的代码:
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome("chromedriver.exe")
driver.set_page_load_timeout(10)
driver.get("https://onlineime.agah.com")
driver.refresh()
time.sleep(45)
login = driver.find_element_by_id("submit-btn")
login.send_keys(Keys.RETURN)
driver.refresh()
driver.set_page_load_timeout(10)
price_tir = driver.find_element_by_xpath("//span[contains(text(), 'SAFTR98')]/ancestor::fieldset//input[@ng-model='item.Price']")
price_mordad = driver.find_element_by_xpath("//span[contains(text(), 'SAFMO98')]/ancestor::fieldset//input[@ng-model='item.Price']")
编辑:现在打开了市场,我在订单列表中放置了2个订单,以下是蓝框元素的代码:
<div class="splitter_panel" style="height: 100px;"><section class="layout-bottom" ng-class="{ maxWidth:hideLayoutR || hideRightMenu }"><div class="tabset" id="espilitBottom"><div class="tab-header"><ul class="tab-header-ul"><li class="tab-header-li active" ng-click="tabSelected = 1" ng-class="{ active:tabSelected == 1 }"> سفارشات فعال <i class="counts ng-binding">2</i></li><li class="tab-header-li" ng-click="tabSelected =2" ng-class="{ active:tabSelected == 2 }"> خطای سفارشات <i class="counts ng-binding">0</i></li><li class="tab-header-li " ng-click="tabSelected = 3" ng-class="{ active:tabSelected == 3 }"> وضعیت موقعیت های باز </li><li class="tab-header-li " ng-click="tabSelected = 4" ng-class="{ active:tabSelected == 4 }"> معاملات امروز <i class="counts"></i></li><li class="tab-header-li" ng-click="tabSelected = 5" ng-class="{ active:tabSelected == 5 }"> وضعیت حساب <i class="counts"></i></li><li class="tab-header-li " ng-click="tabSelected = 6" ng-class="{ active:tabSelected == 6 }"> سود و زیان <i class="counts"></i></li><li class="tab-header-li " ng-click="tabSelected = 7" ng-class="{ active:tabSelected == 7 }"> پیش بینی وضعیت <i class="counts"></i></li></ul></div><div class="tab-body resize-bottom"><!-- ngIf: tabSelected==1 --><!-- ngInclude: '/App/Views/Order/openOrderListInDashborad.html' --><div ng-include="'/App/Views/Order/openOrderListInDashborad.html'" ng-controller="OpenOrderListController" ng-if="tabSelected==1" class="maxheight ng-scope"><form id="antiForgeryOrderListForm" class="maxheight ng-pristine ng-valid ng-scope"><div style="height:calc(100% - 41px);overflow: auto" class="w1360"><table class="table-layot-bottom" show-filter="showFilter"><thead><tr><th><input type="checkbox" ng-model="orderSelection.selectAll" ng-change="selectAll(filteredOrders)" class="ng-pristine ng-untouched ng-valid ng-empty"><span>ردیف</span></th><th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='DecisionId'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">شماره سفارش<span ng-show="predicate=='DecisionId'" class="ng-hide"></span></th><th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='CreationDate'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">ساعت<span ng-show="predicate=='CreationDate'" class="ng-hide"></span></th><th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='ContractCode'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">کد قرارداد<span ng-show="predicate=='ContractCode'" class="ng-hide"></span></th><th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='OrderSide'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc"> نوع سفارش<span ng-show="predicate=='OrderSide'" class="ng-hide"></span></th><th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='TradedQuantity'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">حجم معامله شده<span ng-show="predicate=='TradedQuantity'" class="ng-hide"></span></th><th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='LastRemainigQuantity'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc"> حجم در صف <i title="جمع حجم در صف" class="counts sum ng-binding"> 0 </i><span ng-show="predicate=='LastRemainigQuantity'" class="ng-hide"></span></th><th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='Price'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">قیمت<span ng-show="predicate=='Price'" class="ng-hide"></span></th><th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='DecisionUiState'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">وضعیت<span ng-show="predicate=='DecisionUiState'" class="ng-hide"></span></th><th ng-class="{sortAsc: reverse, sortDesc: !reverse}" ng-click="predicate='Channel'; reverse=!reverse" style="cursor: pointer" class="ng-scope sortDesc">درگاه ثبت<span ng-show="predicate=='Channel'" class="ng-hide"></span></th><th colspan="2"><button type="button" class="btn refresh" tooltip-right="" tooltip="بارگذاری مجدد" ng-click="reload()"><i class="iconRefresh"></i></button></th><th></th></tr><tr ng-show="showFilter" class="tableFilters ng-hide"><th class="filter"></th><th class="filter"></th><th class="filter"><select ng-model="search.ContractCode" ng-options="c.Symbol as c.Symbol for c in symbols" class="ng-pristine ng-untouched ng-valid ng-empty"><option value="string:" selected="selected"></option><option label="SAFTR98 " value="string:SAFTR98 ">SAFTR98 </option><option label="SAFMO98 " value="string:SAFMO98 ">SAFMO98 </option><option label="OSFTR98 " value="string:OSFTR98 ">OSFTR98 </option><option label="OSFMO98 " value="string:OSFMO98 ">OSFMO98 </option></select></th><th class="filter"><select style="width:100%" ng-model="search.OrderSide" class="ng-pristine ng-untouched ng-valid ng-empty"><option value=""></option><option value="0">خرید</option><option value="1">فروش</option></select></th><th class="filter"><input type="text" ng-model="search.TradedQuantity" class="ng-pristine ng-untouched ng-valid ng-empty"></th><th class="filter"><input type="text" ng-model="search.LastRemainigQuantity" class="ng-pristine ng-untouched ng-valid ng-empty"></th><th class="filter"><input type="text" ng-model="search.Price" class="ng-pristine ng-untouched ng-valid ng-empty"></th><th class="filter"><select style="width:100%" ng-model="search.DecisionUiState" class="ng-pristine ng-untouched ng-valid ng-empty"><option value=""></option><option value="101">ثبت شده در بورس</option><option value="109">ثبت شده در سیستم</option><option value="107">رد شده توسط سیستم</option><option value="106">رد شده توسط بورس</option><option value="112">قسمتی معامله شده</option></select></th><th class="filter"><select style="width:100%" ng-model="search.Channel" class="ng-pristine ng-untouched ng-valid ng-empty"><option value=""></option><option value="0">آنلاین</option><option value="1">سما</option><option value="3">صحرا</option><option value="4">سیستم</option></select></th><th class="filter"><input type="text" ng-model="search.DecisionId" class="ng-pristine ng-untouched ng-valid ng-empty"></th><th></th><th style="width:20px!important"></th></tr></thead><tbody loading-container="loading" class="ng-isolate-scope loadingContainer"><!-- ngRepeat: order in (filteredOrders = ($root.orders | orderBy:predicate:reverse | filter:search) ) --><tr ng-repeat-start="order in (filteredOrders = ($root.orders | orderBy:predicate:reverse | filter:search) )" class="ng-scope"><td class="number ng-binding"><!-- ngIf: order.RequestState ==4 || order.InProgressRequests && order.InProgressRequests.length < 0 --><input type="checkbox" ng-model="order.Selected" ng-if="order.RequestState ==4 || order.InProgressRequests && order.InProgressRequests.length < 0" class="ng-pristine ng-untouched ng-valid ng-scope ng-empty"><!-- end ngIf: order.RequestState ==4 || order.InProgressRequests && order.InProgressRequests.length < 0 --> 1 </td><td class="ng-binding">24277213</td><td class="ng-binding">10:12:22</td><td class="ng-binding">SAFMO98 </td><td ng-class="{buy: order.OrderSide == 0, sell: order.OrderSide == 1}" class="ng-binding buy">خرید</td><td class="ng-binding">0</td><td class="ng-binding">1</td><td class="ng-binding">129,900</td><td class="actionbar ng-binding"> ثبت شده در بورس <a tooltip="مشاهده پیغام خطا" class="iconInfo ng-hide" ng-click="showErrorText(order)" ng-show="order.DecisionUiState ==107||order.DecisionUiState ==106"></a><a tooltip="درخواست در بورس تایید شد" class="Font RequestAccept" ng-show="order.DecisionUiState == 101"></a></td><td class="ng-binding">آنلاین</td><td class="actionbar" colspan="2"><a tooltip="نمایش نده" tooltip-left="" class="iconLogout ng-hide" ng-click="hidden(order)" ng-show="order.DecisionUiState ==107||order.DecisionUiState ==106"></a><a tooltip="ویرایش سفارش" class="iconEdit" ng-click="showEditBox(order)" ng-hide="order.RequestState !=4 || order.InProgressRequests && order.InProgressRequests.length > 0"></a><a tooltip="حذف سفارش" class="iconCancel" ng-click="deleteOrder(order)" ng-hide="order.RequestState !=4 || order.InProgressRequests && order.InProgressRequests.length > 0"></a><!-- ngIf: $root.inOrderNote --></td><td></td></tr><!-- ngRepeat: request in order.InProgressRequests --><!-- end ngRepeat: order in (filteredOrders = ($root.orders | orderBy:predicate:reverse | filter:search) ) --><tr ng-repeat-start="order in (filteredOrders = ($root.orders | orderBy:predicate:reverse | filter:search) )" class="ng-scope"><td class="number ng-binding"><!-- ngIf: order.RequestState ==4 || order.InProgressRequests && order.InProgressRequests.length < 0 --><input type="checkbox" ng-model="order.Selected" ng-if="order.RequestState ==4 || order.InProgressRequests && order.InProgressRequests.length < 0" class="ng-pristine ng-untouched ng-valid ng-scope ng-empty"><!-- end ngIf: order.RequestState ==4 || order.InProgressRequests && order.InProgressRequests.length < 0 --> 2 </td><td class="ng-binding">24277212</td><td class="ng-binding">10:12:12</td><td class="ng-binding">SAFMO98 </td><td ng-class="{buy: order.OrderSide == 0, sell: order.OrderSide == 1}" class="ng-binding sell">فروش</td><td class="ng-binding">0</td><td class="ng-binding">1</td><td class="ng-binding">140,000</td><td class="actionbar ng-binding"> ثبت شده در بورس <a tooltip="مشاهده پیغام خطا" class="iconInfo ng-hide" ng-click="showErrorText(order)" ng-show="order.DecisionUiState ==107||order.DecisionUiState ==106"></a><a tooltip="درخواست در بورس تایید شد" class="Font RequestAccept" ng-show="order.DecisionUiState == 101"></a></td><td class="ng-binding">آنلاین</td><td class="actionbar" colspan="2"><a tooltip="نمایش نده" tooltip-left="" class="iconLogout ng-hide" ng-click="hidden(order)" ng-show="order.DecisionUiState ==107||order.DecisionUiState ==106"></a><a tooltip="ویرایش سفارش" class="iconEdit" ng-click="showEditBox(order)" ng-hide="order.RequestState !=4 || order.InProgressRequests && order.InProgressRequests.length > 0"></a><a tooltip="حذف سفارش" class="iconCancel" ng-click="deleteOrder(order)" ng-hide="order.RequestState !=4 || order.InProgressRequests && order.InProgressRequests.length > 0"></a><!-- ngIf: $root.inOrderNote --></td><td></td></tr><!-- ngRepeat: request in order.InProgressRequests --><!-- end ngRepeat: order in (filteredOrders = ($root.orders | orderBy:predicate:reverse | filter:search) ) --><div ng-show="isLoading" class="loading ng-scope ng-hide"><span class="loadingPos"><span class="borderloading"></span><span class="logoLoader"></span></span></div></tbody></table></div><div class="filter-part"><label class="part" ng-init="showFilter=false"><i class="Font Ico-filter" style="cursor: pointer" ng-click="showFilter=!showFilter;"></i></label><label class="part"><span> نوع سفارش: </span><select ng-model="search.OrderSide" ng-options="c.id as c.title for c in orderType" class="ng-pristine ng-untouched ng-valid ng-empty"><option label="همه" value="string:" selected="selected">همه</option><option label="خرید" value="number:0">خرید</option><option label="فروش" value="number:1">فروش</option></select></label> | <label class="part"><span> سررسید: </span><select ng-model="search.ContractCode" ng-options="c.Symbol as c.Symbol for c in symbols" class="ng-pristine ng-untouched ng-valid ng-empty"><option value="string:" selected="selected"></option><option label="SAFTR98 " value="string:SAFTR98 ">SAFTR98 </option><option label="SAFMO98 " value="string:SAFMO98 ">SAFMO98 </option><option label="OSFTR98 " value="string:OSFTR98 ">OSFTR98 </option><option label="OSFMO98 " value="string:OSFMO98 ">OSFMO98 </option></select></label> | <label class="part"><!-- ngIf: selectedOrdersNumber() --></label></div></form> </div><!-- end ngIf: tabSelected==1 --><!-- ngIf: tabSelected == 2 --><!-- ngIf: tabSelected == 3 --><!-- ngIf: tabSelected == 4 --><!-- ngIf: tabSelected == 5 --><!-- ngIf: tabSelected == 6 --><!-- ngIf: tabSelected == 7 --></div></div></section></div>