What's the easiest way to get mechanize for Python 3 on Debian?

本小妞迷上赌 提交于 2019-12-19 03:58:49

问题


I recently wanted to port my scraper that uses mechanize.Browser to Python 3. I haven't found any python3-mechanize package or anything like that. I'm not yet familiar with Python module building with some special procedures so I don't know how would I use 2to3 there. Any suggestions?

@edit: I'm accepting Sibi's answer because it is currently the best. I will be pleased to award any other answer this way, if it just points to a better solution.


回答1:


There's been no activity in the Mechanize repository for several years. Despite the experimental Python 3 branch suggested, it has not been merged and there is no official response to the request for support.

If you're looking for an active project, you may wish to look elsewhere. Two similar projects compatible with Python 3 are

  • MechanicalSoup - "A Python library for automating interaction with websites."
  • RoboBrowser - "a simple, Pythonic library for browsing the web without a standalone web browser."

Both use Requests and BeautifulSoup. As of mid-2015, the latter shows slightly more activity.




回答2:


This is the experimental Python 3 branch of Mechanize: https://github.com/adevore/mechanize/tree/python3

Also see this for more details: http://web.cecs.pdx.edu/~adevore/mechanize/



来源:https://stackoverflow.com/questions/13209778/whats-the-easiest-way-to-get-mechanize-for-python-3-on-debian

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!