gawel / pyquery

A jquery-like library for python
http://pyquery.rtfd.org/
Other
2.3k stars 182 forks source link

xmlns attribute breaks pyquery #187

Closed rockkoca closed 6 years ago

rockkoca commented 6 years ago

h = pq('''<html xmlns="http://www.w3.org/1999/xhtml" ><div ><a href="/" target="_blank" >Main</a></div></html>''') logger.critical(h('a')) cannot get the a tag

After I replace xmlns="http://www.w3.org/1999/xhtml" to mlns="http://www.w3.org/1999/xhtml" or remove it entirely, above code works.

gawel commented 6 years ago

http://pyquery.readthedocs.io/en/latest/api.html#pyquery.pyquery.PyQuery.remove_namespaces