jjlee / mechanize

Stateful programmatic web browsing in Python, after Andy Lester's Perl module WWW::Mechanize .

Home Page:http://wwwsearch.sourceforge.net/mechanize/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Python 3

hickford opened this issue · comments

Found this library incredibly useful in the past, would be great now if mechanize supported Python 3.x . I tried

pip install mechanize

But this happened:

Downloading/unpacking mechanize
  Running setup.py (path:C:\Users\Matt\AppData\Local\Temp\pip_build_Matt\mechanize\setup.py) egg_info for package mechanize

Installing collected packages: mechanize
  Running setup.py install for mechanize
      File "C:\Python34\Lib\site-packages\mechanize\_beautifulsoup.py", line 267
        raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__.__name__, attr)
                            ^
    SyntaxError: invalid syntax

Apologies if this has been reported before, I searched but was surprised not to find an issue.


http://wwwsearch.sourceforge.net/mechanize/faq.html

Python 2.4, 2.5, 2.6, or 2.7. Python 3 is not yet supported.

Meanwhile, I'm making a library with similar functionality, built on Requests and BeautifulSoup. https://github.com/hickford/MechanicalSoup

@fantasyRqg I was trying to find a fix for the problem and tried looking at the link you referred to but was 404'd. Can you please provide the content that was there some time ago.

I see this library has moved to a new home at https://github.com/python-mechanize/mechanize but it's still Python 2 only. It would be a good idea to open an issue there.

In the meantime, we've had good results[1] replacing mechanize with @hickford's MechanicalSoup, thanks for that!

[1] https://github.com/unitedstates/images/blob/gh-pages/scripts/gpo_member_photos.py