开发者

How to select font size bgcolor using selenium

this is my html code and i need to select font size, bgcolor which is there in nonscript.

<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>

    <!-- RE开发者_如何学运维COMMENDED if your web app will not function without JavaScript enabled -->
    <noscript>
      <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
        Your web browser must have JavaScript enabled
        in order for this application to display correctly.
      </div>
    </noscript>

can any budy help with this.

I am using python as my scriptin language.


you just want to grab the text? you can look at something like beautiful soup (which i'm not familiar with), or use a simple regex

import re
m = re.compile(r'background-color: (\w+);',re.I)
result = m.search(text)
if result:
    bgc = result.group(1)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜