I have been looking in the source code of howdoi. https://github.com/gleitz/howdoi
In here the extract_links_from_bing and extract_links_from_google had these kind of syntax.
I tried to search online everything related to xml, element trees but the contructor like syntax is not found anywhere.
Here is the function
def _extract_links_from_bing(html):
html.remove_namespaces()
return [a.attrib['href'] for a in html('.b_algo')('h2')('a')]
def _extract_links_from_google(html):
return [a.attrib['href'] for a in html('.l')] or \
[a.attrib['href'] for a in html('.r')('a')]
My question is how does html('.b_algo')('h2')('a')
iterate. Any links related to similar syntax will be appreciated.
Thanks for reading.