2 ms·
Maybe I'm confused about the problem you're solving but regexp was faster than just: from lxml import html doc = html.from_string(response.content)
by contravariant 6y ago
Maybe I'm confused about the problem you're solving but regexp was faster than just:
from lxml import html
doc = html.from_string(response.content)
doc.xpath('//a/@href')
?
- polote 6y agoYes exactly. I'm not even sure XPath was faster than iter on a tags. But I would need to check on that one