为了账号安全,请及时绑定邮箱和手机立即绑定

写python时一直提示'\w'. String constant might be missing an r prefix

写python时一直提示'\w'. String constant might be missing an r prefix

Pretend10 2019-03-18 21:05:41
代码class Spider():    url = 'https://www.huya.com/g/lol'    root_pattern = '<div class="txt">[\s\S]*?</div>'错误是Anomalous backslash in string: '\s'. String constant might be missing an r prefix.
查看完整描述

2 回答

?
pardon110

TA贡献1038条经验 获得超227个赞

报错信息都告知你了,若想输出字符串常量\s,请用r前缀,即诸如r'\s'这样的形式

查看完整回答
反对 回复 2019-03-19
  • 2 回答
  • 1 关注
  • 8087 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信