Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用过程中出现的问题 #17

Open
zhuanli555 opened this issue Jan 12, 2018 · 6 comments
Open

使用过程中出现的问题 #17

zhuanli555 opened this issue Jan 12, 2018 · 6 comments

Comments

@zhuanli555
Copy link

image
出现字符不能解析的情况
2.
Traceback (most recent call last): File "hero.py", line 56, in results = baiduSearch.search(keyword) File "D:\MillionHeroes-master\baiduSearch\search.py", line 8, in search results = process.page(page) File "D:\MillionHeroes-master\baiduSearch\process.py", line 46, in page result_set = result_set.find_all('div', class_='c-container') # 结果class固定,其余为硬广 AttributeError: 'NoneType' object has no attribute 'find_all'
出现找不到内容的情况

@zhuanli555
Copy link
Author

我测了一下,第一个问题是因为\xa9,\xa0等字符属于latin1 (ISO/IEC_8859-1)中的扩展字符集字符,无法解析,可以在代码中改一下去掉不对的字符
image

@zhuanli555
Copy link
Author

第二个问题昨天12题中会出现好几次,我看了之前同学提的问题和解答,意思是图片没有识别成功?这个百度ocr的正确率也太低了😂

@zhuanli555
Copy link
Author

image
😂更加完善一点

@zhuanli555
Copy link
Author

今晚百万英雄战个痛快😄

@zhuanli555
Copy link
Author

im = Image.open(r'1.png')
r,g,b,a = im.split()
im = Image.merge('RGB',(r,g,b))
im.save(r'2.jpg')
把png格式的转成jpg格式是坠吼的

@wuditken
Copy link
Owner

请提交pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants