elliotgao2 / gain

Web crawling framework based on asyncio.
GNU General Public License v3.0
2.04k stars 207 forks source link

TypeError: write() argument must be str, not dict #25

Closed hyfc closed 7 years ago

hyfc commented 7 years ago

When I ran the Usage code in README.md, a TypeError occured which refers to this line : await f.write(self.results) Then I changed this line to await f.write(self.results['title']) and everything works just fine. I noticed that in previous edition of this README file, when aiofile was not introduced, this part of code used this dict self.results the same way. So I'm not sure which is the right way to print the result.

elliotgao2 commented 7 years ago

Use await f.write(self.results['title']) or await f.write(str(self.results)). I have updated the example.