If I open an html file base_result.htm
with pyquery, it returns [None]
, and throws errors when I search it. If I use that same file as a string, everything works well.
>>> d = PyQuery(filename = 'base_result.html')
>>> d
[None]
>>> f = open('base_result.html')
>>> d = PyQuery(f.read())
>>> d
[<html>]
Its an open issue in PyQuery: https://github.com/gawel/pyquery/issues/22
Some workarounds are mentioned in above link, such as:
or