The far more concise way to do that in bs4 is to use a css selector:
soup.select('div.myclass') # == soup.find_all('div',attrs={'class':'myclass'})
lxml provides cssselect as a module (which actually compiles XPath expressions) and as a convenience method on Element objects.
import lxml.html
tree = lxml.html.fromstring(req.text)
for div in tree.cssselect('div.myclass'):
#stuff
Or optionally you can pre-compile the expression and apply that to your Element:
from lxml.cssselect import CSSSelector
selector = CSSSelector('div.myclass')
selection = selector(tree)