【发布时间】:2018-01-15 08:30:57
【问题描述】:
我为 shopify 购物车制作脚本,因为无法手动购买,当我将脚本运行到命令提示符时, 它说,
第 109 行,在 AttributeError 中:“str' 对象没有属性 '文字
根据所选颜色抓取产品信息
if blue and cinder:
productInfo(urlBlueResponse.text)
productInfo(urlCinderResponse.text)
elif blue:
productInfo(urlBlueResponse.text)
elif cinder:
productInfo(urlCinderResponse.text)
else:
print(Fore.RED + timestamp
有人告诉我这是由于大小写不匹配,有人可以向我解释一下吗?我是编码新手,我想尽我所能学习。
【问题讨论】:
-
我们需要更多上下文(重现问题所必需的“完整”代码、您要执行的操作等)。另外,鉴于您发布的代码 sn-p,我不知道哪一行是 109。
-
它不允许我发布整个脚本第 109 行是 productInfo(urlBlueResponse.text),
-
我正在尝试通过命令脚本购买商品,以便它可以在售罄之前添加到购物车并在 chrome 中打开。通常商品会在一分钟内售罄。
标签: python attributes command