as the question suggests why is the below wrong code would not work but the correct code would?
arent they eseentially the same thing? i looked around and saw the post that explained that the python native list works but the selenium created object list in this case will not work
But i did not really understand it in its essence, could anyone please elaborate alittle further in plain english for a novice programmer please
Wrong Code:
mainText = driver.find_elements_by_css_selector(
'div.post_content.clearfix > p').text
print(mainContentDetail)
List has no attribute text
Correct code:
mainText = driver.find_elements_by_css_selector(
'div.post_content.clearfix > p')
for mainContentDetail in mainText:
print(mainContentDetail.text)