Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The pyquery object that WebTest constructs does not specify the parser:
pyquery
webtest/webtest/response.py
Line 502 in 561ef78
Which means it uses the xml parser:
https://pyquery.readthedocs.io/en/latest/tips.html#using-different-parsers
For html responses, we should be using the html parser. For an example of the difference it makes, consider code inside a <script> tag:
<script>
>>> PyQuery('<html><body><script>var x = "<span></span>"; </script></body></html>').find('span') [<span>] >>> PyQuery('<html><body><script>var x = "<span></span>"; </script></body></html>', parser='html').find('span') []
The latter is what we want, and agrees with what browsers do.
The text was updated successfully, but these errors were encountered:
30d4a7b
The
pyquery
object that WebTest constructs does not specify the parser:webtest/webtest/response.py
Line 502 in 561ef78
Which means it uses the xml parser:
https://pyquery.readthedocs.io/en/latest/tips.html#using-different-parsers
For html responses, we should be using the html parser. For an example of the difference it makes, consider code inside a
<script>
tag:The latter is what we want, and agrees with what browsers do.
The text was updated successfully, but these errors were encountered: