在Pycharm的run界面无论运行任何命令都出现 AttributeError: ‘NoneType‘ object has no attribute ‘loader‘

今天不知道是不是哪里误操作了,在Pycharm的run界面无论运行任何命令都出现  AttributeError: 'NoneType' object has no attribute 'loader',如图1

在运行某些代码时还会出现:SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?,如图2、3

图2 代码:

import requests
from lxml import etree
from chaojiying import Chaojiying_Client
header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36 SLBrowser/7.0.0.5211 SLBChan/25"}
url = 'https://so.gushiwen.org/user/login.aspx?from=http://so.gushiwen.org/user/collect.aspx'
page_text = requests.get(url=url,headers=header).text
tree = etree.HTML(page_text)
code_img_src = 'https://so.gushiwen.org'+tree.xpath('//*[@id="imgCode"]/@src')[0]#解析验证码图片img中src属性值
img_data = requests.get(url=code_img_src,headers=header).content
with open('./爬取验证码.jpg','wb') as fp:
    fp.write(img_data)#将验证码图片保存到了本地
chaojiying = Chaojiying_Client('hc726568076', '123123', '944745')
im = open('//爬取验证码.jpg', 'rb').read()  # 读取保存的图片
print(chaojiying.PostPic(im, 1902))

求各位大佬指点

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值