I have a particular keyword(displayable, not a part of attributes) in a webpage for which I need to know the font-style, font colour and background colour, among other properties. I am using php, and the three options that I have are:-
- Find the hierarchy of the element in which the keyword exists and then combine the inline styles, various css files etc. Too much work and feels like reinventing the wheel.
- Recurse through the xpath to find the keyword, and then use a webdriver to find the properties.
- Use a web-driver to directly find the keyword in the text using some inbuilt function and then find the properties.
Can somebody please offer suggestions/pros/cons for the alternatives present? If your choice is (3), which webdriver would you prefer to use and what is the function that you would use?