회원 로그인
|
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개(11/15페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
85 | [C#] 생성자와 상속 base | 푸딩뱃살 | 3727 | 2014.11.21 02:09 |
84 | [C#] 클래스 상속 | 푸딩뱃살 | 3807 | 2014.11.17 23:35 |
83 | [C#] 클래스 예제 | 푸딩뱃살 | 3282 | 2014.11.03 23:03 |
82 | [C#] Main() 메소드 | 푸딩뱃살 | 3197 | 2014.11.02 23:43 |
81 | [C#] 인덱서 | 푸딩뱃살 | 2698 | 2014.11.01 01:09 |
80 | [C#] 속성 | 푸딩뱃살 | 2737 | 2014.11.01 00:41 |
79 | [C#] 생성자 | 푸딩뱃살 | 2848 | 2014.10.27 01:48 |
78 | [C#] public, private | 푸딩뱃살 | 3076 | 2014.10.25 22:32 |
77 | [C#] 오버로드(overload) | 푸딩뱃살 | 2664 | 2014.10.22 23:02 |
76 | [Python] 웹 파싱, 웹 클라이언트 프로그래밍 httplib | 푸딩뱃살 | 3464 | 2014.10.06 00:46 |
75 | [C#] 스코프(scope) | 푸딩뱃살 | 3272 | 2014.10.02 01:17 |
74 | [C#] 메소드 호출 | 푸딩뱃살 | 2716 | 2014.10.02 00:46 |
73 | [C#] 메소드(method) | 푸딩뱃살 | 3251 | 2014.10.02 00:30 |
72 | [C#] 필드(field) | 푸딩뱃살 | 3132 | 2014.10.02 00:06 |
71 | [C#] 객체(object)의 생성 | 푸딩뱃살 | 3605 | 2014.10.01 23:36 |
70 | [C#] 클래스(class)의 개념 | 푸딩뱃살 | 3511 | 2014.10.01 22:29 |
69 | [기본] 용어 - 클래스, 객체, 인스턴스, 메소드, 필드 | 푸딩뱃살 | 3948 | 2014.05.29 11:36 |
68 | [Python] Python 프로세스 리스트 추출 | 푸딩뱃살 | 8615 | 2014.05.20 16:02 |
67 | [Python] Python 환경 변수 설정 | 푸딩뱃살 | 4221 | 2014.05.20 12:46 |
66 | [Python] Python console 컬러 출력 | 푸딩뱃살 | 5192 | 2014.05.14 22:23 |