欧美一区二区三区,国内熟女精品熟女A片视频小说,日本av网,小鲜肉男男GAY做受XXX网站

如果文本以粗體顯示并帶有硒元素,如何獲取

張吉惟1年前9瀏覽0評論

我有一個這樣的pdf文檔:

\<div class=**"cs6C976429"** style="width:671px;height:18px;line-height:17px;margin-top:98px;margin-left:94px;position:absolute;text-align:left;vertical-align:top;"\>
\<nobr\>INFORMATIONBOLD\</nobr\>\</div\>

\<style type="text/css"\>
.cs85480F5E {color:#000000 !important;background-color:transparent !important;border-left-style: none !important;border-top-style: none !important;border-right-style: none !important;border-bottom-style: none !important;font-family:'Times New Roman' !important; font-size:13px !important; font-weight:normal !important; font-style:normal !important;  !important;}
.cs8B56BD64 {color:#000000 !important;background-color:transparent !important;border-left-style: none !important;border-top-style: none !important;border-right-style: none !important;border-bottom-style: none !important;font-family:'Times New Roman' !important; font-size:15px !important; font-weight:bold !important; font-style:normal !important;  !important;}
**.cs6C976429** {color:#000000 !important;background-color:transparent !important;border-left-style: none !important;border-top-style: none !important;border-right-style: none !important;border-bottom-style: none !important;font-family:'Times New Roman' !important; font-size:15px !important; **font-weight:bold** !important; font-style:normal !important; padding-left:2px !important;}
.cs354AAA62 {color:#808080 !important;background-color:transparent !important;border-left-style: none !important;border-top-style: none !important;border-right-style: none !important;border-bottom-style: none !important;font-family:'Times New Roman' !important; font-size:16px !important; font-weight:bold !important; font-style:normal !important; padding-left:2px !important;padding-right:2px !important;}
\</style\>

我必須驗證selenium的信息粗體是粗體樣式,我用Xpath選擇器找到了樣式:

\//style\[@type='text/css'\]

我無法用Selenium C#的粗體樣式來驗證之前使用的特定類

算法:我只能給你一個算法,因為我不是c#的人。

識別所需的元素并將其存儲到變量中。您可能會使用下面的XPath表達式之一來定位元素

//div[text()='INFORMATIONBOLD']

或者:

//nobr[text()='INFORMATIONBOLD']

將字體粗細CSS值存儲到變量中,如下所示

var fontWeight = webelement.GetCssValue("font-weight");

如果fontWeight大于等于700,則& quot它的粗體& quot Else & quot這并不大膽& quot