회원 로그인
|
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개(12/15페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
65 | [Python] pygame 모듈로 사운드 출력 | 푸딩뱃살 | 9505 | 2014.05.13 18:32 |
64 | [Python] Python 중복 실행 방지 - setuptools, tendo | 푸딩뱃살 | 8087 | 2014.05.08 14:56 |
63 | [Python] Python 메일 보내기 | 푸딩뱃살 | 4795 | 2014.05.08 13:53 |
>> | [Python] BeautifulSoup 파싱 에러 | 푸딩뱃살 | 7158 | 2014.04.22 09:59 |
61 | [Python] BeautifulSoup html 파싱 | 푸딩뱃살 | 7842 | 2014.04.21 17:42 |
60 | [Python] 웹 파싱 모듈 BeautifulSoup 설치 | 푸딩뱃살 | 5807 | 2014.04.21 11:23 |
59 | [C#] C# 예제 | 푸딩뱃살 | 2747 | 2014.04.19 22:24 |
58 | [C#] 제어문 - switch~case문 | 푸딩뱃살 | 3292 | 2014.04.03 19:28 |
57 | [C#] 루프 중단 break, 조건으로 이동 continue | 푸딩뱃살 | 7890 | 2014.03.10 01:32 |
56 | [C#] 제어문 - while문 / do~while문 | 푸딩뱃살 | 3206 | 2014.02.17 14:18 |
55 | [C#] 제어문 - foreach문 | 푸딩뱃살 | 3308 | 2014.02.17 13:58 |
54 | [PHP] PHP 2GB 대용량 업로드 | 푸딩뱃살 | 3694 | 2014.02.13 14:04 |
53 | [C#] 제어문 - for문 | 푸딩뱃살 | 2938 | 2014.02.13 10:36 |
52 | [C#] 제어문 - if문 (복수 수행) | 푸딩뱃살 | 3669 | 2014.02.09 01:31 |
51 | [C#] 제어문 - if문 | 푸딩뱃살 | 3115 | 2014.02.05 14:01 |
50 | [C#] 형의 변환 | 푸딩뱃살 | 2819 | 2014.01.21 13:54 |
49 | [C#] 연산자의 우선순위 | 푸딩뱃살 | 2975 | 2014.01.20 16:24 |
48 | [C#] 논리 연산자 | 푸딩뱃살 | 2729 | 2014.01.14 14:29 |
47 | [C#] 논리형, 조건 연산자 | 푸딩뱃살 | 2845 | 2014.01.14 10:12 |
46 | [C#] C# for Notepad++ plugin | 푸딩뱃살 | 3498 | 2014.01.07 10:34 |