I have specific situation, from Inspect element in Google Chrome I have this:
<span class="markup--quote markup--p-quote is-other" name="anon_7ee3d25bf521" data-creator-ids="anon">If what you care about — or are trying to report on — is impact on the world, it all gets very slippery. You’re not measuring a rectangle, you’re measuring a multi-dimensional space. You have to accept that things are very imperfectly measured and just try to learn as much as you can from multiple metrics and anecdotes.</span>
I want get text based on data-creator-ids="anon" but problem is when I click View Page source this is totally hidden.
I try this:
IWebElement ell = driver.FindElement(By.CssSelector("[data-creator-ids='anon']"));
MessageBox.Show(ell.GetAttribute("innerHTML"));
Problem:
OpenQA.Selenium.NoSuchElementException was unhandled
HResult=-2146233088 Message=no such element: Unable to locate element: {"method":"css selector","selector":"[data-creator-ids='anon']"} (Session info: chrome=48.0.2564.116) (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 10.0 x86_64) Source=WebDriver
I also tried by Class Name but same problem. Is there any trick to get this text?
Also I have one button with same problem, I only need Id but button is totally hidden from html source:
<button class="button button--chromeless" data-action="select-anchor" data-action-value="3331">Top highlight</button>