Hi, anyone here good with lxml?
I'm trying to learn it.
The code within the ' ' for buyers, and the " " for expr is a mystery to me.
what is // ?
what is * ?
what is [ ] brackets for ?
what is @x ?
what is local ?
what is text() ?
is this html embedded in python? Is there a webpage that explains all this stuff?
The webpages I'm trying to learn off assume I know all this already
http://python-docs.readthedocs.io/en/lat...crape.html
http://lxml.de/xpathxslt.html
I'm trying to learn it.
page = requests.get('http://econpy.pythonanywhere.com/ex/001.html') tree = html.fromstring(page.content) buyers = tree.xpath('//div[@title="buyer-name"]/text()')also another snippet...
expr = "//*[local-name() = $name]" print(root.xpath(expr, name = "foo")[0].tag)output = foo
The code within the ' ' for buyers, and the " " for expr is a mystery to me.
what is // ?
what is * ?
what is [ ] brackets for ?
what is @x ?
what is local ?
what is text() ?
is this html embedded in python? Is there a webpage that explains all this stuff?
The webpages I'm trying to learn off assume I know all this already
http://python-docs.readthedocs.io/en/lat...crape.html
http://lxml.de/xpathxslt.html