I am trying to get some data from https://www.facebook.com/public/nitin-solanki page. I can get all values apart from these label (values for these label I am already getting)
Someone suggested me to use Javascript executer with python to get these label, which I added, but they do not print any value neither give error.
Studied at
Lives in
From
driver.get("https://www.facebook.com/public/nitin-solanki")
wait = WebDriverWait(driver, 10)
wait.until(EC.visibility_of_element_located((By.CLASS_NAME, "mbm")))
for s in driver.find_elements_by_css_selector('.mbm.detailedsearch_result'):
result = {}
v = s.find_element_by_css_selector('.fsm.fwn.fcg')
x = v.find_elements_by_class_name('fbProfileBylineLabel')
for y in x:
#print y.text #this should give me label like lives in, studied at but does not
#js line which does not give any result
print x.executeScript("return arguments[0].childNodes[0].nodeValue;");
print driver.executeScript("return arguments[0].childNodes[0].nodeValue;",x);
#js ends
z = y.find_elements_by_tag_name('a')
for a in z:
print a.text #I want to get label for this value along with it
print y.text
works for me;executeScript
is not a Python Selenium method,execute_script
isy.text
in dictionary?a
,v
,z
as the name of variable