weixin_41713869
DOM初心者
采纳率0%
2019-10-16 09:48 阅读 466

TypeError: 'unicode' object is not callable 错误 python2.7

刚学python 写的def的线程都不可用,于是模仿别人单线程直接插多线程,就出现以下错误,写的爬虫,线程是出来了,但是就是不能调用unicode,求大神解答

# -*- coding: utf-8 -*

import sys
reload(sys)
sys.setdefaultencoding('utf8')

import requests
import re
import time
import threading
import sys
import Queue as queue
import sys
import datetime

live = open('未爬.txt','w')
die = open('已爬.txt','w')
input_queue = queue.Queue()



list = raw__input("--> Enter Lists : ")
thread = input(" -> Thread : ")
link = “************”
head = {'User-agent':'Mozilla/5.0 (Linux; U; Android 4.4.2; en-US; HM NOTE 1W Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 UCBrowser/11.0.5.850 U3/0.8.0 Mobile Safari/534.30'}
s = requests.session()
g = s.get(link, headers=head)
list = open(list, 'r')_

print('')
print("-"*50)
print("-"*50)


while True:

        网页导入 = list.readline().replace('\n','')
        if not www:
            continue
        bacot = email.strip().split(':')
        xxx = {''************''}

        cek = s.post(link, headers=head, data=xxx).text
        if "************" in cek:
            print("|未爬|----->"+网页+"")
            live.write(网页+"\n")
        else: 
            print("|已爬 | -----> "+网页+" ")
            die.write(网页+"\n")

        for x in range(int(thread)):
            t = threading.Thread(target=cek)
            t.setDaemon(True)
            t.start()


print('')
print('-------------------------------------------------')
print('')_

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

相关推荐