파이썬(Python) 3.x에서는 mechanize 사용이 불가능합니다. 대책은?

조회 2,637 · 댓글 0
강철지그강철지그작성자2017년 7월 11일
mechanize 많이 사용하시죠.


$ pip3 install mechanize

Collecting mechanize
Downloading mechanize-0.3.5.tar.gz (201kB)
100% |????????????????????????????????| 204kB 1.1MB/s
Complete output from command python setup.py egg_info:
mechanize only works on python 2.x

----------------------------------------


하지만 mechanize는 파이썬 버전 3에서는 사용이 불가능합니다.

그럼 대책은요?

MechanicalSoup은 어때요?


$ pip3 install MechanicalSoup

Collecting MechanicalSoup
Downloading MechanicalSoup-0.7.0-py2.py3-none-any.whl
Collecting six>=1.4 (from MechanicalSoup)
Downloading six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.0 in /app/python361/lib/python3.6/site-packages (from MechanicalSoup)
Requirement already satisfied: beautifulsoup4 in /app/python361/lib/python3.6/site-packages (from MechanicalSoup)
Requirement already satisfied: idna<2.6,>=2.5 in /app/python361/lib/python3.6/site-packages (from requests>=2.0->MechanicalSoup)
Requirement already satisfied: urllib3<1.22,>=1.21.1 in /app/python361/lib/python3.6/site-packages (from requests>=2.0->MechanicalSoup)
Requirement already satisfied: certifi>=2017.4.17 in /app/python361/lib/python3.6/site-packages (from requests>=2.0->MechanicalSoup)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /app/python361/lib/python3.6/site-packages (from requests>=2.0->MechanicalSoup)
Installing collected packages: six, MechanicalSoup
Successfully installed MechanicalSoup-0.7.0 six-1.10.0

로그인 후 답글을 남길 수 있습니다.