BeautifulSoup4
parsing with lxml
as the backend may have issues in Windows if lxml
is not installed properly.
I encountered BS4
not correctly parse html content when lxml
is installed with pip
.
I red the lxml
’s FAQ:
Two of the major design issues of this operating system make it non-trivial for its users to build lxml: the lack of a pre-installed standard compiler and the missing package management.
Christoph Gohlke generously provides unofficial lxml binary builds for Windows that are usually very up to date. Consider using them if you prefer a binary build over a signed official source release.
After installed Christoph Gohlke’s lxml
package, the issue gone.