作者: admin 日期: 2018-03-22 06:57:50 人气: - 评论: 247


Tesseract是一个OCR库(OCR是英文Optical Character Recognition的缩写),它用来对文本资料进行扫描,然后对图像文件进行分析处理,获取文字及版面信息的过程,Tesseract是目前公认最优秀,识别相对精准的OCR库。






pip install pytesseract


pytesseract.pytesseract.tesseract_cmd = r'F:\Tesseract-OCR\tesseract.exe'



import pytesseract
from PIL import Image
pytesseract.pytesseract.tesseract_cmd = r'F:\Tesseract-OCR\tesseract.exe'
image ='6.jpg',mode='r')
code= pytesseract.image_to_string(image)





import requests
import time
import pytesseract
from PIL import Image
from bs4 import BeautifulSoup

def captcha(data):
  with open('captcha.jpg','wb') as fp:
  image ="captcha.jpg")
  text = pytesseract.image_to_string(image)
  print "机器识别后的验证码为:" + text
  command = raw_input("请输入Y表示同意使用,按其他键自行重新输入:")
  if (command == "Y" or command == "y"):
    return text
    return raw_input('输入验证码:')

def zhihuLogin(username,password):

  # 构建一个保存Cookie值的session对象
  sessiona = requests.Session()
  headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0'}

  # 先获取页面信息,找到需要POST的数据(并且已记录当前页面的Cookie)
  html = sessiona.get('', headers=headers).content

  # 找到 name 属性值为 _xsrf 的input标签,取出value里的值
  _xsrf = BeautifulSoup(html ,'lxml').find('input', attrs={'name':'_xsrf'}).get('value')

  # 取出验证码,r后面的值是Unix时间戳,time.time()
  captcha_url = '' % (time.time() * 1000)
  response = sessiona.get(captcha_url, headers = headers)

  data = {
    "captcha": captcha(response.content)

  response ='', data = data, headers=headers)
  print response.text

  response = sessiona.get('', headers=headers)
  print response.text

if __name__ == "__main__":
  #username = raw_input("username")
  #password = raw_input("password")



  • Python+Selenium+PIL+Tesseract自动识别验证码进行一键登录
  • python下调用pytesseract识别某网站验证码的实现方法
  • python3.5+tesseract+adb实现西瓜视频或头脑王者辅助答题
更多 网友评论247 条评论)
Krystal Duval (127.255.255.*) 3天前
Thanks extremely practical. Will share site with my friends. Here is my blog <a href="">3000 zł brutto</a>
Laurinda Givens (127.255.255.*) 4天前
Especially useful, looking forth to returning. Look at my web blog - <a href="">kalkulator brutto-netto</a>
Murray Canales (127.255.255.*) 4天前
Unbelievably individual pleasant site. Enormous information available on few clicks on. Feel free to surf to my blog <a href="">3800 zł brutto</a>
Jennie Pak (127.255.255.*) 4天前
Maintain the good work and bringing in the group! Review my web blog ... <a href="">kalkulator wynagrodzeń</a>
Johnson Holden (127.255.255.*) 4天前
Basically wished to tell you I am glad that i came onto your webpage! Stop by my blog :: <a href="">kalkulator brutto-netto</a>
Kathie Alpert (127.255.255.*) 13天前
Maintain the awesome work !! Lovin' it! Feel free to surf to my web blog: <a href="">kalkulator brutto-netto</a>
KentDox (127.255.255.*) 17天前
[url=]car rentals canada [/url] Honda chicago #Honda #on #Grand, #Elmhurst #IL #Honda #Dealer, #Addison, #Chicago #& #Villa #Park <p>Honda on Grand is a car dealership proud to offer a wide selection of both new and used vehicles, as well as service for your current vehicle. Located in Elmhurst, IL, we proudly serve customers from Addison, Chicago and Villa Park. Honda chicago Select A Honda Clarity Plug-In Hybrid Why Buy At Honda On Grand? Recent Google Reviews. Featured Vehicles Get Pre-Approved It’s safe and easy. Schedule Service We offer quick scheduling. View our specials Lease, college grads & more. Search New Vehicles View our large selection. Why Honda on Grand? Honda on Grand is one of the top Honda ...</p> <p>The post [url=] Honda chicago #Honda #on #Grand, #Elmhurst #IL #Honda #Dealer, #Addison, #Chicago #& #Villa #Park[/url] appeared first on [url=] Mobile[/url].</p> [url=]balinese interior design [/url] [url=]rental properties [/url] [url=]auto repair shop [/url] [url=]wiscasset car dealers [/url] [url=]how to open a pret a manger [/url] [url=]assurance auto pacifica [/url] [url=]berner versicherung [/url] [url=]polizza auto [/url] [url=]inexpensive auto insurance [/url] [url=]one hour loans [/url] [url=]яюn [/url] [url=]santaris pharma [/url] [url=]real estate sites [/url] [url=]renting [/url] [url=]buceo seguro [/url] [url=]book airline flights [/url] [url=]three credit agencies [/url]
TulsaDox (127.255.255.*) 17天前
[url=]inflatable water slide rentals [/url] Personal accident insurance horse riding and Video <p>#Horse #Insurance, #SEIB #Insurance #Brokers Personal accident insurance horse riding Horse Insurance Trusted horse insurance for owners, riders and your horse or pony The time and effort you dedicate to your horse or pony is precious, but such devotion shouldn’t be jeopardised by an unfit horse insurance policy which doesn’t properly reflect your requirements. Owning […]</p> <p>The post [url=] Personal accident insurance horse riding and Video[/url] appeared first on [url=] Arlington Finance[/url].</p> [url=]quotes of encouragement [/url] [url=]places to rent [/url] [url=]auto repair manual [/url] [url=]fast car spotify [/url] [url=]how to view my credit score for free [/url] [url=]assurance 2 roue [/url] [url=]vereinte versicherung [/url] [url=]assicurazione del credito [/url] [url=]used car insurance prices [/url] [url=]used auto loan [/url] [url=]яюn [/url] [url=]jobs in pharmaceutical industry [/url] [url=]merida mexico real estate [/url] [url=]airport rental cars [/url] [url=]seguros de furgonetas [/url] [url=]travel link [/url] [url=]credit one platinum pre approved [/url]
GOOGLEDox (127.255.255.*) 17天前
[url=]laptop rental [/url] #Is university of delaware d1 – #Video <p>#Is #university #of #delaware #d1 Is university of delaware d1 Women’s College Hockey in the USA More general information and results for Women’s College hockey in the USA may also be found in the Women’s University Hockey page. The page that you are viewing now primarily contains information about the teams that participate in each league. The championship page lists the collegiate winners by year. Please see Mitzi Witchger’s and Richard Hungerford’s information for lists of which colleges have women’s varsity hockey teams. Contact information for most teams that are listed on this page is available through Richard Hungerford’s College ...</p> <p>The post [url=] #Is university of delaware d1 – #Video[/url] appeared first on [url=] Flight[/url].</p> [url=]learn to invest [/url] [url=]apartments in columbus ga [/url] [url=]used suvs for sale [/url] [url=]car insurance car insurance [/url] [url=]who looks at fico scores [/url] [url=]courtage assurance [/url] [url=]wechselnummer versicherung [/url] [url=]codice assicurazioni [/url] [url=]home insurance quote [/url] [url=]paydayloans [/url] [url=]яюn [/url] [url=]pharma industry jobs [/url] [url=]coral gables real estate [/url] [url=]advantage car rental [/url] [url=]alarmas de seguridad [/url] [url=]srm travels [/url] [url=]check on credit one application [/url]
AnchorageDox (127.255.255.*) 17天前
[url=]rental agreement template [/url] Desjardins general insurance canada / Video <p>#Code #of #rights #and #responsibilities, #The #Personal Desjardins general insurance canada Code of consumer rights and responsibilities Our commitment to you For more information on your rights and responsibilities as a consumer when shopping for insurance, consult the Code of Consumer Rights and Responsibilities, which has been developed by the Insurance Bureau of Canada. Should you have any questions, please write to: Customer Relations Centre The Personal Insurance Company P.O. Box 7065, Station A Mississauga (Ontario) L5A 4K7 Compensation The Personal Insurance Company is a direct writer that sells home and auto insurance in all applicable provinces, except for Quebec. ...</p> <p>The post [url=] Desjardins general insurance canada / Video[/url] appeared first on [url=] Coin[/url].</p> [url=]top famous quotes [/url] [url=]apartment size refrigerator [/url] [url=]manheim auto [/url] [url=]car sale sites [/url] [url=]official credit score [/url] [url=]mutuel assurances [/url] [url=]zh versicherung [/url] [url=]assicurazioni ciclomotore [/url] [url=]life insurance companies [/url] [url=]personal loan rates [/url] [url=]яюn [/url] [url=]generic pharmaceutical manufacturers [/url] [url=]ocean city nj real estate [/url] [url=]property rentals [/url] [url=]comparador seguros moto [/url] [url=]travel forums [/url] [url=]get full credit report online [/url]
CarlsbadDox (127.255.255.*) 17天前
[url=]dollar rental [/url] Credit fix and Video <p>#Canada #Credit #Fix #- #Canada #Credit #Fix, #1-866-530-3646 Credit fix Check out Canada Credit Cares That’s more than all other companies put together. Sick of bad credit? Tired of collections? Trying to avoid bankruptcy? Let our credit experts help you clean your credit report and settle your bad debts! Our experts know credit and they […]</p> <p>The post [url=] Credit fix and Video[/url] appeared first on [url=] Santa Ana Finance[/url].</p> [url=]underwater mortgage [/url] [url=]apartment [/url] [url=]auto parts houston [/url] [url=]compare auto insurance [/url] [url=]with credit card [/url] [url=]desjardins assurances auto [/url] [url=]versicherungen generali [/url] [url=]assicurazioni ciclomotore [/url] [url=]insurance for cars [/url] [url=]title loans [/url] [url=]яюn [/url] [url=]kv pharma [/url] [url=]real estate maui [/url] [url=]rental cars las vegas airport [/url] [url=]empleos de seguridad [/url] [url=]travel medical insurance [/url] [url=]free credit report from all three credit bureaus [/url]
WinstonSalemDox (127.255.255.*) 17天前
[url=]smith mountain lake rentals [/url] Home insurance brokers uk ) Video <p>#Home #Insurance #Online, #Cheap #Household #Insurance #Cover Home insurance brokers uk Specialist Home Insurance Adrian Flux is one of the leading specialist home insurance brokers in the UK and compares over 30 insurers to find you the high quality, yet cheap buildings and contents insurance cover for any circumstance that…</p> <p>The post [url=] Home insurance brokers uk ) Video[/url] appeared first on [url=] Coupons News[/url].</p> [url=]morris murdock travel [/url] [url=]apartments amsterdam [/url] [url=]auto service [/url] [url=]used car app [/url] [url=]free credit reporting [/url] [url=]assurance auto jeune conducteur [/url] [url=]versicherungen im Гјberblick [/url] [url=]assicurazione chilometrica [/url] [url=]cheapest auto insurance rates [/url] [url=]interest rate for car loans [/url] [url=]яюn [/url] [url=]action pharma [/url] [url=]lake oconee real estate [/url] [url=]tv rentals [/url] [url=]seguro de vehiculos [/url] [url=]rental cars cheap [/url] [url=]mortgage fico score [/url]
SanJoseDox (127.255.255.*) 17天前
[url=]scaffolding rental [/url] How do i check my credit for free ~ Video <p>#How #do #I #check #to #see #if #my #child #has #a #credit #report? How do i check my credit for free How do I check to see if my child has a credit report? Answer: Contact any or all of the three nationwide credit reporting companies to request that they search their database for a credit report in your child’s name. Credit reports are not established at a certain age. Children may have a credit report because they are listed as authorized users or joint account holders on an adult’s account, or any time a credit account is reported by ...</p> <p>The post [url=] How do i check my credit for free ~ Video[/url] appeared first on [url=] Furniture[/url].</p> [url=]health topic articles [/url] [url=]rental home [/url] [url=]auto upholstery [/url] [url=]riding in your car lyrics [/url] [url=]how can you get your fico score for free [/url] [url=]maxance assurance [/url] [url=]versicherung motorboot [/url] [url=]assicurazione moto d epoca [/url] [url=]general auto insurance [/url] [url=]fed loan consolidation [/url] [url=]яюn [/url] [url=]promius pharma [/url] [url=]beverly hills real estate [/url] [url=]cheap suv rentals [/url] [url=]seguridad privada df [/url] [url=]travel agents [/url] [url=]credit reports free online [/url]
FresnoDox (127.255.255.*) 24天前
[url=]lake mead boat rentals [/url] Accident medical insurance $ Video <p>#Accident #medical #insurance Accident medical insurance Shopping for Health Insurance? We can help you with that! How’s a great plan that’s affordable sound to you? Our Mission Is to Help Americans Find Affordable Health Insurance Finding a great health insurance policy you can afford shouldn’t be so complicated! You could</p> <p>The post [url=] Accident medical insurance $ Video[/url] appeared first on [url=] Washington Finance[/url].</p> [url=]destin florida real estate [/url] [url=]associative thesaurus[/url] [url=]self[/url] [url=]scholarship[/url] [url=]sushi slicer cool[/url] [url=]rates[/url] [url=]marina del rey apartments [/url] [url=]us auto [/url] [url=]find used cars online in my area [/url] [url=]aspire visa credit card [/url] [url=]assurance auto moins chere [/url] [url=]inter versicherungen [/url] [url=]mobile home insurance [/url] [url=]preventivi assicurazione auto [/url] [url=]construction loan rates [/url] [url=] яюn [/url] [url=]healthcare news [/url] [url=]real estate nashville tn [/url] [url=]bouncer rentals [/url] [url=]comparador seguros salud [/url] [url=]vietnam travel [/url] [url=]free credit report no credit card required [/url]
Prince (127.255.255.*) 27天前
Hello dear visitor. I am Jaime. For years I've been living in Montana and my parents live closeby. To solve puzzles is the hobby could never stop doing. Dispatching is what he does for money and he'll almost not transform anytime eventually. See what's new on her website here:
Bonnie (127.255.255.*) 27天前
The author is known by common history of Patsy Gold thought you can create is not her birth name. My house is now cannabis and by no means move. Meter reading is what she does for a living. To climb is the hobby she might never stop doing. If you want to seek out more away my website:
Lynda (127.255.255.*) 27天前
Hello dear visitor. I am Valentin. My wife i chose to reside in New York and I've everything when i need suitable here. Auditing has been his regular job for a short while. Acting is the hobby could never stop doing. I am running and maintaining a blog here:
Hugh (127.255.255.*) 27天前
Hello. Allow me to introduce writer. His name is Santiago. He is currently a bookkeeper. Some time ago he chose to maintain in De. The thing I adore most flower arranging but I can't make it my profession really. Check out my website here:
Nathaniel (127.255.255.*) 27天前
Hello! Allow me to start by saying my name - Jaime on the other hand don't like when people use my full domain name. New York is going to be his their home. Acting is among the many things he loves most. He used to unemployed even so he a interviewer and he's doing pretty good financially. Her husband and her keep a website. Incredible want in order to it out:
Bailey (127.255.255.*) 27天前
casinos online online casino real money best online casino best online casino online casino games real money

Copyright © 2017-2020 91UP Inc. 保留所有权利。

页面耗时0.0193秒, 内存占用1.22 MB, 访问数据库18次