快捷导航

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

代码


class Spider():
    url = 'https://www.huya.com/g/lol'
    root_pattern = '[\s\S]*?
'
错误是Anomalous backslash in string: '\s'. String constant might be missing an r prefix.

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员1

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

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP