DOM初心者 2019-10-16 09:48 采纳率: 0%
浏览 503

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('')_

  • 写回答

0条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 SpringBoot项目启动报错:No active profile set, falling back to default profiles:default,如何解决?
      • ¥15 部署confluence设置数据库这个步骤时,提示必须配置utf8 作为默认字符集
      • ¥15 如何脱离Photoshop实现ps脚本的渲染
      • ¥15 丙类高频放大器匹配网络
      • ¥15 Pytorch框架nn.RNN训练时反向传播报错
      • ¥60 添加:普通链接二维码,的时候,总是提示校验文件检查失败
      • ¥15 react的使用问题
      • ¥150 关于#算法#的问题,如何解决?动态平衡算法实现
      • ¥20 苹果手机开启蓝牙和Wi-Fi 按钮后黑客是否可以入侵该手机?
      • ¥15 关于#hadoop#的问题:1.为什么我这里会显示中午数字2.为什么我会连接失败打不开local host