慕粉1180023
2016-09-24 09:48
为啥这么报错= = ValueError: chr() arg not in range(256)
C:\Python27\python.exe E:/download/python/crawler.py
Traceback (most recent call last):
File "E:/download/python/crawler.py", line 26, in <module>
from pdfminer.converter import PDFPageAggregator
File "C:\Python27\lib\site-packages\pdfminer\converter.py", line 4, in <module>
from .pdfdevice import PDFTextDevice
File "C:\Python27\lib\site-packages\pdfminer\pdfdevice.py", line 2, in <module>
from .utils import mult_matrix, translate_matrix
File "C:\Python27\lib\site-packages\pdfminer\utils.py", line 212, in <module>
0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
File "C:\Python27\lib\site-packages\pdfminer\utils.py", line 180, in <genexpr>
PDFDocEncoding = ''.join( chr(x) for x in (
ValueError: chr() arg not in range(256)
我也遇到了同样的问题,且装的是pdfminer
utils.py里面的chr(x)改成unichr(x)即可
卸载pdfminer3k,装pdfminer2
Traceback (most recent call last):
File "C:\Users\Administrator\PycharmProjects\python\baike\spider_main.py", line 33, in <module>
obj_spider.craw(root_url)
File "C:\Users\Administrator\PycharmProjects\python\baike\spider_main.py", line 20, in craw
new_urls,new_data=self.parser.parse(new_url,html_cont)
TypeError: 'NoneType' object is not iterable
检查了地址会不会返回NONE 没错啊感觉
奇怪了
看不到代码,但是看起来并不会有问题:
#!/usr/bin/env python # -*- coding: utf-8 -*- str = "-" re = str.join(chr(x) for x in range(10)) print(re)
python遇见数据采集
59669 学习 · 200 问题
相似问题