mechanize icon indicating copy to clipboard operation
mechanize copied to clipboard

Support Python 3

Open hickford opened this issue 11 years ago • 4 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.

hickford avatar May 15 '14 00:05 hickford

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

hickford avatar Jun 02 '14 19:06 hickford

Try this http://web.cecs.pdx.edu/~adevore/mechanize/

fantasyRqg avatar Nov 12 '14 06:11 fantasyRqg

@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.

AyushyaChitransh avatar Apr 01 '17 10:04 AyushyaChitransh

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

hugovk avatar Apr 01 '17 12:04 hugovk