I am trying to collect information from a webpage and cannot get the correct XPath to find it. Here is a piece from a website:
<div class="posted">
<div>
June 20, 2018
</div>
</div>
I want to search each page for this divide class that says "posted", then return everything under it as a string. (A messy string is ok; I will just use "if "2018" in "possibleDate"" to search for the year) Here is what I am trying:
possibleDate = str(tree.xpath("//div[contains(@class, ’posted’)]//@text"))
It says that it is an invalid expression.
What am I doing wrong?