회원 로그인
|
BeautifulSoup 파싱 에러
| BeautifulSoup 파싱 에러
집PC는 파싱이 가능하고, 회사PC는 불가능한 상황
혹시나 컴퓨터 사양 타나 싶은가 해서 알아보았지만 그건 아닌거 같고..(집PC는 intel, 회사PC는 amd를 사용)
설치 완료 후 코딩을 돌려서 나오는 경고!!
아래 경고를 보면 BeautifulSoup에선 버그가 아니라고 나오고 있고, 구글링해도 해결 방법 특별하게 나오고 있지 않고...
(검색 된 사이트 : http://stackoverflow.com/questions/12886619/beautifulsoup-cant-parse-a-webpage)
Warning (from warnings module): File "C:\Python26\lib\site-packages\bs4\builder\_htmlparser.py", line 149 "Python's built-in HTMLParser cannot parse the given document. This is not a bug in Beautiful Soup. The best solution is to install an external parser (lxml or html5lib), and use Beautiful Soup with that parser. See http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser for help.")) RuntimeWarning: Python's built-in HTMLParser cannot parse the given document. This is not a bug in Beautiful Soup. The best solution is to install an external parser (lxml or html5lib), and use Beautiful Soup with that parser. See http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser for help. Traceback (most recent call last): File "\경로\ex.py", line 98, in <module> legoCartOuput(urlList_) File "\경로\ex.py", line 75, in legoCartOuput legoCartCheck(inUrl_) File "\경로\ex.py", line 55, in legoCartCheck soup_ = BeautifulSoup(page_.read()) File "C:\Python26\lib\site-packages\bs4\__init__.py", line 172, in __init__ self._feed() File "C:\Python26\lib\site-packages\bs4\__init__.py", line 185, in _feed self.builder.feed(self.markup) File "C:\Python26\lib\site-packages\bs4\builder\_htmlparser.py", line 150, in feed raise e HTMLParseError: bad end tag: u'</scr"+"ipt>', at line 5707, column 78 |
BeautifulSoup import
Python 2.6.x 이하는 import urllib
Python 2.7.x은 import urllib2
Python 3.x은 import urllib.request
집PC - Python v2.7.6 (32bit), BeautifulSoup v4.3.2
회사PC - Python v2.7.2 (32bit), BeautifulSoup v4.3.2
해결)
Python 버전이 맞지 않는 걸 확인, 바로 집 버젼과 같은 2.7.6로 재설치 후 코딩을 돌리보니 바로 작동. -_-;; Python 버전 호환성 문제였다.
댓글 0개
| 엮인글 0개
285개(1/15페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
285 | [Python] 동적 import - 모듈을 변수로 받아오기 | 푸딩뱃살 | 414 | 2022.10.27 10:45 |
284 | [Python] 파이썬 3.7.7과 3.9.7의 os.path.expanduser() 차이 | 푸딩뱃살 | 457 | 2022.08.18 12:22 |
283 | [Python] error: Microsoft Visual C++ 9.0 is required. | 푸딩뱃살 | 687 | 2022.08.03 13:35 |
282 | [Python] pyscript | 푸딩뱃살 | 457 | 2022.06.09 11:21 |
281 | [Python] float is / float not is | 푸딩뱃살 | 596 | 2022.03.02 15:03 |
280 | [Python] 이터널 문자열 f | 푸딩뱃살 | 835 | 2022.01.27 16:35 |
279 | [Python] is와 ==의 차이 | 푸딩뱃살 | 486 | 2021.11.25 15:54 |
278 |
[Python] Error: ImportError: file |
푸딩뱃살 | 920 | 2021.11.16 11:24 |
277 | [Python] 파이썬 디컴파일 - uncompyle6 | 푸딩뱃살 | 776 | 2021.11.10 14:46 |
276 | [Python] 파이썬 확장자 설명 | 푸딩뱃살 | 551 | 2021.11.03 14:38 |
275 | [참고] 웹 fbx 뷰어 | 푸딩뱃살 | 472 | 2021.10.19 15:46 |
274 | [Python] enumerate() | 푸딩뱃살 | 501 | 2021.10.13 14:44 |
273 | [Python] 아나콘다에서 가상 환경 | 푸딩뱃살 | 724 | 2020.11.21 00:26 |
272 | [Python] pip로 설치 때 퍼미션 에러 | 푸딩뱃살 | 1269 | 2020.06.06 17:13 |
271 | [Python] OpenCV 10-3. 이미지 Thresholding - Otsu's Binarizatio | 푸딩뱃살 | 675 | 2020.06.05 14:01 |
270 | [Python] OpenCV 10-2. 이미지 Thresholding - Adaptive Threshold | 푸딩뱃살 | 697 | 2020.06.05 13:58 |
269 | [Python] OpenCV 10-1. 이미지 Thresholding | 푸딩뱃살 | 579 | 2020.06.05 13:56 |
268 | [Python] OpenCV 9-2. 색 추적 | 푸딩뱃살 | 775 | 2020.06.02 23:29 |
267 | [Python] OpenCV 9-1. 색공간 바꾸기 | 푸딩뱃살 | 642 | 2020.06.02 23:27 |
266 | [Python] OpenCV 8-3. 이미지 비트 연산 | 푸딩뱃살 | 531 | 2020.06.02 23:21 |