특정 날짜와 관련된 값 (시간)을 선택해야합니다. 예를 들어 아래의 html에서 번호 6을 기준으로 24:20의 숫자를 읽어야합니다. 내가 사용하는 경우셀렌과 C를 사용하여 텍스트를 선택하는 방법 #
<div class="day-ofmonth">
<div class="day-ofmonth">
<span class="day-num">6</span>
<span class="available-time">24:20</span>
</div>
<div class="day-ofmonth">
<span class="day-num">7</span>
<span class="available-time">133:50</span>
</div>
<div class="day-ofmonth">
<div class="day-ofmonth">
: 이는 HTML입니다
IWebElement t_value = d.FindElement(By.XPath(".//* [@id='calinfo']/div[9]/span[2]"));
var t_again2 = t_value.GetAttribute("textContent");
내가 24:20 얻을 것이다; 하지만 난 (이 경우) 숫자 6 (6 월의 날짜를 말합니다)과 Xpath (매일 다른 날짜가 될 것입니다)에 따라 24시 20 분 값을해야합니다. 사람이 올바른 방향으로 날 지점 수 있다면, 감사
는 요소지만 출력을 찾을 않습니다는 다음과 같습니다 OpenQA.Selenium.Remote.RemoteWebElement – user2669905
' .Text' 속성은'WebElement'에서 텍스트 내용을 가져옵니다. ToString() 대신 miscalling을 사용하고 있습니까? 당신이 얻고있는 WebElement를 디버깅 할 것을 제안합니다. – kurakura88
고맙다. 나는 xpath를 문자열로 나누고 [i] : xpath (stringXpath)를 사용하여 테이블을 파싱하여 돌아 다닐 수 있었다. stringXpath = one + i + two – user2669905