When the Tweets figure on someone's Twitter page is in the thousands, Twitter rounds it to e.g 12.4K. When you move the mouse over this element, a tooltip tells you the true number e.g. 12,412.
I'm looking to get this actual figure using Selenium WebDriver (probably with its find_element_by_xpath
function).
If we take this Twitter page as an example, and inspect the element in Firebug:
Note that for Firebug to display this HTML, I needed to first click on, in the Style tab of the sidebar:
And the XPath for the anchor is:
/html/body/div[2]/div[2]/div/div[1]/div/div[2]/div/div/div[2]/div/div/ul/li[1]/a
From there, I would think I could simply tag on /@data-original-title
to this Xpath, and any program that tries to fetch this would succeed. Yet both Webdriver's find_element_by_xpath
nor Google Sheet's importXml()
fail to retreive anything.
I know very little about Javascript or CSS, but I imagine that the fact that I needed to click on the "Inherited From" would suggest that one or both are involved in my challenge. If so, how so? Can such an XPath query ever succeed in a case like this? If not, how can the exact Tweets number be gotten?
@ Webdriver Experts: Is there a way of mimicking such a mouseover in order to retrieve this value?