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

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 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog